[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: guile-gi: scancode->keyval?

From: Mike Gran
Subject: Re: guile-gi: scancode->keyval?
Date: Thu, 6 Jun 2019 20:45:56 -0700
User-agent: Mutt/1.11.3 (2019-02-01)

On Thu, Jun 06, 2019 at 10:16:14PM +0200, Jan Nieuwenhuizen wrote:
> Hi Mike,
> I've update the Guix package and started using (send event
> (get-scancode)), which works great.  However, scancodes are somewhat
> inconvenient, iwbn to get the keyval or character through
> gdk-keyval-to-unicode.
> I would expect `get-keyval' and `get-keycode' methods on event but only
> found predicate-like variants:
>    (send event (get-keyval?)) => (#t 0)
>    (send event (get-keycode?)) => (#t 0)

I hadn't implemented automated wrapping of C procedures that return
output via pointer to plain C types, such as

  gboolean gdk_event_get_keyval (const GdkEvent *event,
                                 guint *keyval);

I fixed it, I think.

There are many, many unit tests to be written and memory allocations
to be checked. Sigh.

> Hmm.
> Then I went to look for a more low level function using the Keymap
>     (let ((keymap (Keymap-get-default)))
> also works and then I'm lost again...something like this might work
>     (send keymap (translate-keyboard-state? scancode MODIFIER_TYPE_SHIFT_MASK 
> =>
>     GuileGI:ERROR:gi_giargument.c:1665:convert_interface_arg_to_object: 
> assertion failed: (type_tag == GI_TYPE_TAG_INTERFACE)

I'll look into it.


Mike Gran

reply via email to

[Prev in Thread] Current Thread [Next in Thread]