maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [REQUEST] HW Keyboard -> Multitouch emulation (https://talk.maemo.org/showthread.php?t=65717)

azstunt 2010-12-25 19:59

Re: an idea to fix the preenv games multitouch problem .
 
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).

jaimex2 2010-12-26 05:02

Re: an idea to fix the preenv games multitouch problem .
 
Quote:

Originally Posted by azstunt (Post 904196)
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).

Great find, I'll play with that when I get home today. I'm guessing it ignores a second input if a tap is already in progress.

I wonder if quick mili second alternating between two tap locations would pass as multitouch on the games.

azstunt 2010-12-26 06:25

Re: an idea to fix the preenv games multitouch problem .
 
Quote:

Originally Posted by jaimex2 (Post 904382)
Great find, I'll play with that when I get home today. I'm guessing it ignores a second input if a tap is already in progress.

I wonder if quick mili second alternating between two tap locations would pass as multitouch on the games.

It doesn't. Already tried it. If you emulate the start of a touch at x1,y1 (but don't end it) and then physically touch at x2,y2, it is interpreted as something like an 'instant drag' (as in infinite speed movement) between x1,y1 to x2,y2 (test it with the draw app).

javispedro 2010-12-28 12:13

Re: an idea to fix the preenv games multitouch problem .
 
We already know what fake multitouch is, and why it sucks.

ivgalvez 2010-12-28 13:11

Re: an idea to fix the preenv games multitouch problem .
 
Why do I have the impression that allgoodidea and govprog are the same person?

Ah! it's because their lack of politeness.

MaddogG 2010-12-28 13:42

Re: an idea to fix the preenv games multitouch problem .
 
@govprog

Do you know what you are talking about? :p
The files you have posted are C# classes: they are pretty useless. They could be used to develop C# or Mono multitouch applications, but they will not help anyone to satisfy our desire to have multitouch emulation in preenv games.

As I said in another thread, if we want multitouch emulation we need multi-point support from X server. Once we will obtain that, we could take in consideration azstunt idea (emulation with hardware keyboard). Until then: no way!

I tried to write a little application to emulate multitouch using Qt, but
  • It's difficult
  • Results are not satisfactory
  • We can't achieve system-wide emulation without X multitouch support (we have to insert emulation directly in the code of every program)

If we really want multitouch emulation, we need to start talking about porting multitouch support in X server (http://www.fooishbar.org/blog/tech/x...-17-18-22.html).

Regards :)

govprog 2010-12-28 13:46

Re: an idea to fix the preenv games multitouch problem .
 
Quote:

Originally Posted by ivgalvez (Post 905975)
Why do I have the impression that allgoodidea and govprog are the same person?

Ah! it's because their lack of politeness.

The only proof I have that I am not someone else is my IP. And please tell me how it was not polite, and I will change it if it's bothering you.(And I don't want to bother a great programmer like javispedro, because it is both some kind of forum violation and unfair.) and finally, don't look at my posts in the bad way please, this may happen because my english is not very good:o

govprog 2010-12-28 13:55

Re: an idea to fix the preenv games multitouch problem .
 
Quote:

Originally Posted by MaddogG (Post 905995)
@govprog

Do you know what you are talking about? :p
The files you have posted are C# classes: they are pretty useless. They could be used to develop C# or Mono multitouch applications, but they will not help anyone to satisfy our desire to have multitouch emulation in preenv games.

As I said in another thread, if we want multitouch emulation we need multi-point support from X server. Once we will obtain that, we could take in consideration azstunt idea (emulation with hardware keyboard). Until then: no way!

I tried to write a little application to emulate multitouch using Qt, but
  • It's difficult
  • Results are not satisfactory
  • We can't achieve system-wide emulation without X multitouch support (we have to insert emulation directly in the code of every program)

If we really want multitouch emulation, we need to start talking about porting multitouch support in X server (http://www.fooishbar.org/blog/tech/x...-17-18-22.html).

Regards :)

The files are C# because they were taken from windows SDK,and they are not mine. I have a question. can we port the C# code to the X-Server and compile them for it?

MaddogG 2010-12-28 13:59

Re: an idea to fix the preenv games multitouch problem .
 
Quote:

Originally Posted by govprog (Post 906011)
The files are C# because they were taken from windows SDK,and they are not mine.

I know that :)
The problem is that they are for Windows, we can't directly use them.

Quote:

I have a question. can't we port the C# code to the X-Server and compile them for it?
If you mean translate that code in C and include it in X server, well...to be honest, I don't know if this is possible, but it woud be cool :cool:

marmistrz 2012-06-07 14:09

Re: [REQUEST] HW Keyboard -> Multitouch emulation
 
And is something like that possible: the microb zoom gesture triggers the multitouch zoom gesture?
It's nice to be able to zoom stuff. I've got one app from MeeGo that's barely useable without zooming.


All times are GMT. The time now is 07:24.

vBulletin® Version 3.8.8