TouchScreen Lib for blitz3D

Blitz3D Forums/Blitz3D Userlibs/TouchScreen Lib for blitz3D

Osoko(Posted 2014) [#1]
I want to control my apps using a touchscreen !

here some decls that i've found for user.dll

Api_GetTouchInputInfo% (hTouchInput%,cInputs%,pInputs*,cbSize) : "GetTouchInputInfo"
Api_RegisterTouchWindow(Hwnd%,TWFFlag%)	: "RegisterTouchWindow"
Api_UnRegisterTouchWindow(Hwnd%)	: "UnregisterTouchWindow"
Api_SetGestureConfig(Hwnd%,dwReserved%,GestureConfigID%,GestureType*,SizeOfTypeCreated%): "SetGestureConfig"
APi_WindowProc(Hwnd%,Umsg%,wParam%,lParam%) : "WindowProc"
Api_GetContactIndex(dwID%) : "GetContactIndex"
api_FindWindowEx% (hWnd1%, hWnd2%, lpsz1$, lpsz2$) : "FindWindowExA"


I want to get the number and the coords of the touchscreen points. I've trying to use C++ with a form comming from blitzClose.dll. As this dll seems not to be anywhere in the forum, i put a dowload link, which is not permanent.

http://dl.free.fr/nf49zI7nm

You can email me to get it when this link will be over, or maybe can someone host it and give a link.


For this touchScreen lib, protocols are differents in W7 and W8. I,ve made some research in C++ for W7 but i'm realy new to this language...





Further, i don't know if i should use visual C++, when installing the last one ( after having forgotten this subject during a year ), i see a lot of things changed and i wasn't able to test the dll. It need a form for this that i don't understand.

So help welcome !


Osoko(Posted 2015) [#2]
I've still no response, but Blizt 3D should be Fun with tactil mode on W8 !


Guy Fawkes(Posted 2015) [#3]
What's your email? I tried sending an email, but the one in your profile doesn't work.


Osoko(Posted 2015) [#4]
HI Guy, the one from my profile should work. Please let me know if you can't contact me. I would be so happy to receive your email !


Osoko(Posted 2015) [#5]
I've found something that could help : The number of Touch the touchscreen can handle

api_GetSystemMetrics(SM_MAXIMUMTOUCHES)

With :

Cont SM_MAXIMUMTOUCHES% = 95

And the decls for user32.dll

api_GetSystemMetrics% (nIndex%) : "GetSystemMetrics"


Osoko(Posted 2015) [#6]
Other things : get the cursor Xpos with decls for user32.dll

api_GetCursorPos% (lpPoint*) : "GetCursorPos"
Function PointerX()

		B=CreateBank(8)
		api_GetCursorPos(B)
		answer=PeekInt(B,0*4)
		FreeBank(B)
		Return answer
		
End Function

Can't get the Y pos...
I presume this can't help much for touchscreen, but could help understanding this bank concept...


Osoko(Posted 2015) [#7]
The point structure seem to be easy...
https://msdn.microsoft.com/en-us/library/windows/desktop/dd162805(v=vs.85).aspx


Osoko(Posted 2015) [#8]
Found this : how to get a fast response of the touch screen

On Windows 7/8, the touch detection is in gesture mode by default, this means that if you just put your finger on the screen without any movement, there is no response. The response comes with movemetn of the finger or by removing the finger.

If you want a button to react immediatly on the touch, you have to disable this gesture mode.

https://msdn.microsoft.com/en-us/library/windows/desktop/dd317326(v=vs.85).aspx

code to put before the main loop...

Const TWF_WANTPALM = $00000002

AppTitle MyAppsTitle	; the title of your apps...
hWnd  =  api_FindWindow("Blitz Runtime Class", MyAppsTitle$)
RegisterTouchWindow(hWnd,TWF_WANTPALM) 



Rick Nasher(Posted 2015) [#9]
Wauw! Good stuff. Way to go Osoko, this is really something needed for new Windows laptops with touchscreen.


Osoko(Posted 2015) [#10]
Thank's Rick, hope this could help a bit, but the real challenge is to build this touchscreen DLL. I'm still unable to have the coords and the number of the fingers touching the screen !
At least i'm able to have a fast react of the touchscreen, with the code above. One fast reacting finger is a good beginning...

So help still welcome for C++ Code implementation and how to build the DLL :)


virtlands(Posted 2015) [#11]
Hi Osoko,

I'm looking forward to this 'touchscreen' code of yours. { I have a touchscreen laptop. }

I've hosted that zip onto my OneDrive:: BlitzCloseOriginal.zip

--> http://1drv.ms/1BsMirA
--> http://1drv.ms/1zkFO05
--> http://tinyurl.com/mb99mm7

Click on any of those 3 links.

As an experimental setting, I've set the permission to "Recipients Can Edit", so that people may change the source.




Guy Fawkes(Posted 2015) [#12]
Me too! I'm excited as well! =D


Osoko(Posted 2015) [#13]
Happy yo get some news back from some rest !

What i succeed : get fast response on windows 7 For One touch by desactiving the gesture recognization. ( RegisterTouchWindow(hWnd,TWF_WANTPALM)

This recognization has the default to be slow.This is the default settings from windows : if you touch a button, the action is parsed only when you remove your finger or move it a little....

It doesnt react if you just put your finger on the button and don't move it. I have this behaviour on W7 and W8.1 ( i have updated W8... )

I'm ready to work on this but i don't know well C++ neither the connection with blitz. That why i started which blitzclose as a template.

I've installed visual studio 2013 on W8.1, i presume it it a correct choice for making the DLL. But i don't know how to test the dll. The dll has to be launch by an exe, and a have for now no idea of the form to use...


Osoko(Posted 2015) [#14]
Does Someone know how to set up Visual studio 2013 to run a DLL ?
Does Someone know a correct form to build Dll for Blitz3D on Windows 8.1 ?

I need to use the last win8 touchscreen funtions...