Re: keycode handling



Vlad Harchev <hvv hippo ru> writes: 
> Solution:
>  I propose to extend GdkEventKey even further, by addition of the following
> members (sorry, stupid names - suggest a better ones):
>  gint	keyval_g0; 
>  gint 	keyval_g0_l0;
> 

People can just call gdk_key_info_to_keyval () to get these values
when appropriate.

We should go ahead and make GtkAccelGroup GtkBindingSet etc. use them.

It isn't right to use them outside of accelerators though, so you
can't just swap them in to apps in all cases.

Conceivably we should have an abstraction:

 guint gdk_keycode_get_key_cap (guint keycode);

which returns the "accelerator key" for the key code.

Note that I did something different for Ctrl-Shift-hexdigit: I first
see if the keyval in the current group/level is a hexdigit, and use it
if so, otherwise I scan the list of keysyms for the pressed key code,
and if any of them are hexdigits I use that hexdigit. So this is
fallback to any group/level that happens to have the digits, not just
0/0.

Havoc




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