vialab / Touch2Tuio

Touch2Tuio source for executables shipped in vialab/SMT, based on http://dm.tzi.de/touch2tuio/
16 stars 9 forks source link

Touch2Tuio only sends first "touch down" when touch moves or is released. (WIN 7) #1

Closed maujabur closed 10 years ago

maujabur commented 10 years ago

Background: I've been testing the SMT library that uses Touch2Tuio.

On WINDOWS 7 it does not behave exactly as I expected (but runs fine on W8).

The problem is that it does not recognize touches until I move the finger or double click the surface.

I was able to detect that the problem is in this version of Touch2Tuio and his DLL.

I ran a Tuio Dump program and got the following output:

starting TuioDump

7056ms add cursor 0 (0) 0.40584895 0.52068514
7057ms remove cursor 0 (0)

9528ms add cursor 0 (1) 0.39110938 0.54665744
9529ms remove cursor 0 (1)

11433ms add cursor 0 (2) 0.39556772 0.5131759
11436ms remove cursor 0 (2)

12634ms add cursor 0 (3) 0.43755728 0.54769444
12635ms remove cursor 0 (3)

14506ms add cursor 0 (4) 0.43172917 0.46477777
14523ms update cursor 0 (4) 0.42360935 0.4994722 2.3754628 158.36418
14540ms update cursor 0 (4) 0.42360935 0.4994722 0.0 -148.46642
14556ms update cursor 0 (4) 0.42360935 0.4994722 0.0 0.0
14622ms update cursor 0 (4) 0.42248437 0.5011852 0.12808487 8.005304
14639ms update cursor 0 (4) 0.42248437 0.5011852 0.0 -8.538991
14658ms update cursor 0 (4) 0.42248437 0.5011852 0.0 0.0
14739ms remove cursor 0 (4)
16643ms add cursor 0 (5) 0.41183332 0.5342963
16645ms remove cursor 0 (5)

Note that there are very few milliseconds between the add and remove cursor, or between add and update cursor.

I've tested this in several different machines and touch enabled displays and got the same resuilts. And I tested it on one machine running windows 8 and it was working fine.

If I use the version 0.2 of the program found here: http://dm.tzi.de/touch2tuio/ the touches are recognized fine (but it has a nasty delay on the touch up, but that you already know)

Thanks!

ZachCook commented 10 years ago

This was compiled with Visual Studio 2012 I believe, if you want to try rebuilding yourself before @KiwiStrongis can get to it.

We should link the previous discussion here too: https://github.com/vialab/SMT/issues/170

maujabur commented 10 years ago

I guess I found the problem on windows 7!!

on TouchHook.cpp the following line (51) is commented out:

//const ULONG TOUCH_FLAGS(/*TWF_FINETOUCH|*/TWF_WANTPALM);

and this one was changed (228) from the original:

RegisterTouchWindow(msg->hwnd, 0);

I propose changing them to

const ULONG TOUCH_FLAGS_2(/*TWF_FINETOUCH|*/TWF_WANTPALM);

and

RegisterTouchWindow(msg->hwnd, TOUCH_FLAGS_2);

I had to change the const name in order to compile for windows 8 without errors.

I'll test it on windows 8 later to see if it keeps working as well.

kiwistrongis commented 10 years ago

If you've fixed it, feel free to send a pull request. I'll merge and do a quick verification :).

kiwistrongis commented 10 years ago

Fixed as of b98633095b19dbcfc7eb8e7d23f629530f652752, but it still needs to be tested on windows 8.

paluka commented 9 years ago

Needs to be compiled and tested on Windows 7 as well.