View Single Post
Posts: 43 | Thanked: 32 times | Joined on Jan 2010
#21
I have succesfully mapped a key press to a touchscreen action using a combination of cat, a hex editor and xbindkeys doing something like this (as root):
Code:
cat ~/actioninhexcode >> /dev/input/event3
where the file ~/actioninhexcode contains something like this (hex code):
Code:
11 EC 05 4D  2B D2 00 00  03 00 00 00  00 08 00 00
11 EC 05 4D  87 D2 00 00  03 00 01 00  00 08 00 00
11 EC 05 4D  A5 D2 00 00  03 00 18 00  C5 00 00 00
11 EC 05 4D  A5 D2 00 00  01 00 4A 01  01 00 00 00
11 EC 05 4D  A5 D2 00 00  00 00 00 00  00 00 00 00
11 EC 05 4D  D1 73 01 00  03 00 18 00  00 00 00 00
11 EC 05 4D  0E 74 01 00  01 00 4A 01  00 00 00 00
11 EC 05 4D  0E 74 01 00  00 00 00 00  00 00 00 00
where each line has the folloing format:
Code:
struct input_event {
    __u32 tv_sec;
    __u32 tv_usec;
    __u16 type;
    __u16 code;
    __s32 value;
};
The above example will emulate a tap approximately in the middle of the screen (test it with the draw application). If you want to emulate a drag you will need three files and to 'cat' them individually, one with the start coordinates, amount of pressure and the touch event started; the next one with the end coordinates; and the last one with an amount of pressure zero and which also ends the touch.
Then you map any key you want to the above command using xbindkeys.
My point being, if anybody changes the touchscreen driver for a multitouch one and adds multitouch support for the xserver (maybe not needed?), something like the above could be used in combination of normal touchscreen usage (I guess).
 

The Following 5 Users Say Thank You to azstunt For This Useful Post: