a...@ac13.de wrote:

> I try to send a string to an input field of an application. I think the
> only way is to use the XSendEvent function and send the keycode of every
> single character of my string. But how could I get the special keys like
> shift or alt for characters like '%'?

XKeysymToKeycode() converts KeySyms to keycodes. You can find the
keysyms in <X11/keysymdef.h>, e.g. XK_percent for '%'. Or you can look
at the output from "xmodmap -pk", and add the XK_ prefix. Or you can
enumerate the keyboard mapping yourself with XGetKeyboardMapping() and
call XKeysymToString() on each KeySym.

You probably don't need to explicitly send Alt/Shift/etc events;
simply setting the state field in the XKeyEvent structure should
suffice.

-- 
Glynn Clements <gl...@gclements.plus.com>
_______________________________________________
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

Reply via email to