0
votes

The program I'm working on a virtual keyboard of sorts that requires unicode. Using the code I've received from http://goo.gl/pv9ht and it works for normal (ASCII) keysyms when converting to a keycode, but XKeysymToKeycode() returns 0 on a keysym like XK_agrave (include/X11/keysymdefs.h).

I'm also not quite sure how to do the same with capitals. When I try the same with XK_A (that's capital 'A'), it returns the same keycode as 'a'. This does make sense since they are the same keycode (along with a bunch of other characters) according to the output 'xmodmap -pke'. But how do I make it send (XSendKeyEvent) the capital form of the keycode?

Help would be much appreciated.

1

1 Answers

1
votes

You send with a modifier key (shift in this case)

So you set XKeyEvent->state |= ShiftMask

The state member is set to indicate the logical state of the pointer buttons and modifier keys just prior to the event, which is the bitwise inclusive OR of one or more of the button or modifier key masks: Button1Mask, Button2Mask, Button3Mask, Button4Mask, Button5Mask, ShiftMask, LockMask, ControlMask, Mod1Mask, Mod2Mask, Mod3Mask, Mod4Mask, and Mod5Mask.

Source: http://linux.die.net/man/3/xkeyevent