Windows, touchscreen and mousepressed


#1

Ok, so i have this strange problem.

I use a windows 7 machine with a single touch screen. I disabled all touch functionality like hold and richt mouse click.

Everywhere in windows, putting my finger on the screen will dispatch a mouse down event. This happens in air, flash and even in paint(putting my finger on the screen will draw a 1x1 pixel).

The problem is that inside OpenFrameworks (glut, gl), there won’t be an event until is move my finger. So when you don’t move your finger, the release function and the press are called at the same time.

Even GetKeyState(VK_LBUTTON) will output 0 until my finger moves.

Doen anyone have a solution or explanation to this weird problem?


#2

ok, found the solution!
You first need to register your app as touch capable for Windows.

just use this code in your setup:

  
  
	ofSetWindowTitle("touchApp");  
	HWND hwnd;  
	hwnd = FindWindowA(0, "touchApp");  
	RegisterTouchWindow(hwnd, TWF_FINETOUCH);  
  


#3

Hi sander,

I use CodeBlocks and it doesn’t recognise “RegisterTouchWindow(hwnd, TWF_FINETOUCH);” command
Can you tell me what IDE are you using, and what library or header you had to include?
thank you very much

bnc

[quote author=“sander”]ok, found the solution!
You first need to register your app as touch capable for Windows.

just use this code in your setup:

  
  
	ofSetWindowTitle("touchApp");  
	HWND hwnd;  
	hwnd = FindWindowA(0, "touchApp");  
	RegisterTouchWindow(hwnd, TWF_FINETOUCH);  
  

[/quote]