3

Im trying to change the input language in gtk , without asking the user to change his keyboard layout(just for one program), can i do that?

If not can i change the layout?(i think i cant)

If not can i get the key that the user inputed .Not the character(because it could be unicode or another language) i just want the key.Example:User pressed 'K' on the keyboard with layout Arabic ,but i dont want the Arabic character as output i want 'K'.

All 3 ways will solve my problem. I'll choose the laziest ofcourse.

I program in c gtk2 ,ok?

PRO META X
  • 31
  • 2
  • For alphanumeric keys and punctuation you can use `GdkEventKey.hardware_keycode` and compare its value against the [IBM set 1 scancodes](http://www.quadibloc.com/comp/scan.htm). Raw scancodes are positional and should, with a small number of exceptions (where they are only in slightly different positions; read the page) map to the key at the same physical location on the keyboard regardless of keyboard layout. For everything else you can use GDK keyvals. This is what [my code](https://github.com/andlabs/ui/blob/master/area_unix.go) does, anyway. – andlabs Jan 22 '15 at 14:40

0 Answers0