Java: Keymap values

294 views Asked by At

I am trying to modify the program tight vnc for some special Keyboard shortcuts. One includes the letter P, but that is not provided by the keymap implementation of the program, and I would like to add it. The probelm I run into is that I don't know where the program gets it's values from. I believe the keymap for p should be 0x0112 but I cannot identify the exact notion they use.

Below is a link to the code on google code. Does anyone recognize the values they use?

https://code.google.com/p/tightvncpanel/source/browse/trunk/src/main/java/com/glavsoft/utils/Keymap.java?r=39

1

There are 1 answers

0
Duffydake On

I think it's 0x70.
I started xev and press left shift :

KeyRelease event, serial 38, synthetic NO, window 0x3000001,
root 0x2a6, subw 0x0, time 80385581, (1027,483), root:(1028,529),
state 0x11, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
XLookupString gives 0 bytes: 
XFilterEvent returns: False

As you can see the keysym value is 0xffe1 like in the source code

And for p :

KeyPress event, serial 38, synthetic NO, window 0x3000001,
root 0x2a6, subw 0x0, time 80216212, (191,-19), root:(192,27),
state 0x10, keycode 33 (keysym 0x70, p), same_screen YES,
XLookupString gives 1 bytes: (70) "p"
XmbLookupString gives 1 bytes: (70) "p"
XFilterEvent returns: False

I don't know what is keysym but it seems to be what the code use.

EDIT

keysym : The symbolic name of a key on a keyboard.