[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: GTK, keycodes and keysyms
- From: Philip Kendall <pak ast cam ac uk>
- To: GTK Applications Development List <gtk-app-devel-list mail gnome org>
- Subject: Re: GTK, keycodes and keysyms
- Date: Sat, 30 Dec 2000 17:22:59 +0000
On Fri, Dec 29, 2000 at 06:19:01PM -0500, Havoc Pennington wrote:
>
> Philip Kendall <pak@ast.cam.ac.uk> writes:
> >
> > The previous version did this by calling XLookupKeysym(event,0), thus
> > giving me the keysym corresponding to the unshifted key, but GDK has
> > already done this lookup for me with the shift etc. modifiers applied...
> > gdk_keyval_to_lower(...) works for letters, but not for (say) Shift+3.
> >
> > Is there any way I can get around this, or am I going to have to go
> > behind GTK's back somehow?
> >
>
> I recently added some code related to this to GTK+ 1.3.x (unstable
> version), for a similar reason - for keyboard accelerators and in some
> other cases, we want the keycap instead of the keysym.
>
> I'll append the code. This feature is not in GTK 1.2, but you could
> probably adapt this code to make things work.
[snip useful code]
Basically, a much more efficient version of what I eventually came up
with:
guint unshift_keysym(guint keysym)
{
/* Oh boy is this ugly! */
return XKeycodeToKeysym(gdk_display,
XKeysymToKeycode(gdk_display,keysym),
0);
}
Slow and ugly, but it works :-)
Thanks for the help!
Cheers,
Phil
--
Philip Kendall <pak@ast.cam.ac.uk>
http://www.srcf.ucam.org/~pak21/
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]