PDA

View Full Version : How to pass key event to linux OS??



Jaga
26th May 2015, 11:24
Hi,
I m trying to develop virtualkeyboard in Linux to enter texts in the current text editor. In windows, for sending the keycode to OS there is API called sendInput().
How to pass the keycode of the key pressed to the Linux OS ?

Thanks in advance.
Regards,
Jaga.:)

ChrisW67
30th May 2015, 06:04
XSendEvent (http://tronche.com/gui/x/xlib/event-handling/XSendEvent.html), at least for X11 systems.
And an Example (http://www.doctort.org/adam/nerd-notes/x11-fake-keypress-event.html)

Jaga
11th June 2015, 12:50
Thanks for your reply Chris.

This method is OK for me right now.

Regards,
Jaga

Jaga
14th July 2015, 11:35
Hi all,

XSendEvent is not working for unicode characters like Ä,ä,Ö,ö,Ü,ü etc and also both the character 'A' and 'a' is printed as 'a' when the modifier flag is 0 or printed as 'A' when the modifier flag is 1 irrespective of the keycode passed , how to set the modifier flag in XKeyEvent structure depending on the keycode.

Thanks in Advance:-)

Regards,
Jaga.