GTK, keycodes and keysyms



Hi.

I'm developing a GTK+ application to emulate the ZX Spectrum (a home
computer from the 1980s, very popular in Britain) [1]. As `Shift' on
this machine had a very different meaning from that on modern machines,
I'd like to know which key was pressed, rather than which keysym it
produced (ie so that Shift+3 gives me the same result, independent of
whether Shift+3 gives me a sterling sign, a hash sign or whatever).

[1] If anyone wants to see the previous (non-GTK+) version, it's at
http://www.srcf.ucam.org/~pak21/spectrum/fuse.html

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?

Thanks for any advice!

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]