Pages: 1 2 »
  Print  
Author Topic: Windows 8 touch support  (Read 3856 times)
Offline (Unknown gender) wufik
Posted on: September 05, 2014, 02:44:29 AM
Member
Joined: Nov 2013
Posts: 1

View Profile
Hi, I'm trying to create a simple on-screen gamepad for use with a touchscreen on a Windows 8 tablet, but using mouse events doesn't work properly:
  • buttons must either be double tapped, or I have to tap and then move my finger a bit for the mouse click to register
  • tough it's not that important to me, multitouch is obviously not supported

Does anyone know a simple to understand (or at least simple to implement without fully understanding?  ;)) solution or workaround to my problems?
I'd be grateful for any info, even if it's just "it can't be done with Enigma, period"
Logged
Offline (Unknown gender) TheExDeus
Reply #1 Posted on: September 05, 2014, 09:03:03 AM

Developer
Joined: Apr 2008
Posts: 1872

View Profile
As we will have to implement touchscreen functions at some point anyway, and we already support windows8.1, then I guess we should look into that. Windows probably has some kind of API for this. I sadly don't have time for that now (and I don't have a win8 touchscreen device).
Logged
Online  (Male) Josh @ Dreamland
Reply #2 Posted on: September 06, 2014, 10:38:42 AM

Prince of all Goldfish
Developer
Location: Pittsburgh, PA, USA
Joined: Feb 2008
Posts: 2950

View Profile Email
I hate to suggest this, but, we could easily make mouse_x and y a var, and then assign multitouch points to the other indices. The less icky approach is just to create functions to fetch pointer information by index, and query the number and validity of pointers. Pointer information includes pressure and sometimes rotation (such as on the Wii). Validity isn't always a dense function—any of the four Wii remotes can be off-screen, and it would not surprise me if later tablets distinguish between fingers and one or more styluses.
Logged
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble
"I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
Offline (Male) Goombert
Reply #3 Posted on: September 06, 2014, 10:45:44 AM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3107

View Profile
Looks like Studio created a separate set of functions purely for this purpose.
http://docs.yoyogames.com/source/dadiospice/002_reference/mouse,%20keyboard%20and%20other%20controls/device%20input/index.html

Actually it looks like most of the touch functions are part of user32 which is included in MinGW. Silly me I didn't think about touchscreen monitors.
http://msdn.microsoft.com/en-us/library/windows/desktop/dd371582%28v=vs.85%29.aspx

I wonder if I were to wrap these functions in Win32 if they would work for a Windows 8 tablet.
« Last Edit: September 06, 2014, 10:49:31 AM by Robert B Colton » Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Unknown gender) daz
Reply #4 Posted on: September 11, 2014, 02:44:20 AM
Contributor
Joined: Jul 2010
Posts: 167

View Profile
I wonder if I were to wrap these functions in Win32 if they would work for a Windows 8 tablet.
Go for it! I have a Windows tablet shipping to me by Saturday. I'd be willing to test your fork if you implement the changes. Otherwise I'll go poking around myself sometime and see if I can't add touch support myself.
Logged
Offline (Male) HitCoder
Reply #5 Posted on: September 16, 2014, 05:59:58 PM

Member
Location: King's Lynn, England
Joined: Aug 2014
Posts: 151

View Profile WWW Email
What I'd do personally, is make it check if the mouse is on top of the object, and find the distance from the center to the mouse while the mouse distance is less than a certain amount. Not sure if that makes any sense, but it's an idea.
Logged
DISCORD: HitCoder#4530
hi my name is John Cooper and i'm not good at anything
Offline (Unknown gender) TheExDeus
Reply #6 Posted on: September 17, 2014, 03:02:22 AM

Developer
Joined: Apr 2008
Posts: 1872

View Profile
Hit, I think you misunderstood the problem. He needs multitouch support, because otherwise he can't even one click. You must double tap for windows to emulate one mouse click. There is nothing in GML/EDL he can do to stop that. Additional engine code must be written for that.
Logged
Offline (Male) HitCoder
Reply #7 Posted on: September 28, 2014, 11:17:19 AM

Member
Location: King's Lynn, England
Joined: Aug 2014
Posts: 151

View Profile WWW Email
Hit, I think you misunderstood the problem. He needs multitouch support, because otherwise he can't even one click. You must double tap for windows to emulate one mouse click. There is nothing in GML/EDL he can do to stop that. Additional engine code must be written for that.

I still don't get it, I have a windows 8 tablet (can't run exes mind you), but it seems to be a single click on each tap on the screen.

Anyway, my idea was not using mouse clicks, but to get the position of the cursor, and check the distance from the cursor, if it's below a certain amount, go to mouse_x and mouse_y
Logged
DISCORD: HitCoder#4530
hi my name is John Cooper and i'm not good at anything
Offline (Unknown gender) daz
Reply #8 Posted on: September 29, 2014, 02:01:57 PM
Contributor
Joined: Jul 2010
Posts: 167

View Profile
On my Windows 8 tablet (with full Windows 8), it is tap to click, tap and hold to right click. Currently even tapping works in ENIGMA for mouse clicks, because Windows emulates the mouse if there is no touch support. However I would very much like multitouch, which simply cannot be done without additional APIs.

I've been looking into adding this functionality into ENIGMA myself, however I'm waiting until the repo commits cool off.

I also checked on the GMC and got a response from Dailly -- GM doesn't even support multitouch on native Windows outside of building a Windows 8 app. It would be ideal to get this working for native in ENIGMA but we'll see what happens.
Logged
Offline (Male) Goombert
Reply #9 Posted on: September 29, 2014, 03:58:45 PM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3107

View Profile
Quote from: daz
I also checked on the GMC and got a response from Dailly -- GM doesn't even support multitouch on native Windows outside of building a Windows 8 app. It would be ideal to get this working for native in ENIGMA but we'll see what happens.

What? It's literally part of WinAPI since Windows Vista. Don't worry I'll write the functions if I can find the time and throw them in an extension, they're real easy to do.
Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Unknown gender) daz
Reply #10 Posted on: September 29, 2014, 05:49:29 PM
Contributor
Joined: Jul 2010
Posts: 167

View Profile
Yeah, here is the topic for reference: http://gmc.yoyogames.com/index.php?showtopic=638233#entry4656468

My guess would be that he wants to ensure the games run on as many versions of Windows as possible, and by including touch support they'd be excluding XP and Vista. Maybe there's also a separate API for Windows 8 touch, I haven't looked too deeply into it.
Logged
Offline (Male) edsquare
Reply #11 Posted on: September 29, 2014, 07:17:27 PM

Member
Location: The throne of ringworld
Joined: Apr 2014
Posts: 402

View Profile
Yeah, here is the topic for reference: http://gmc.yoyogames.com/index.php?showtopic=638233#entry4656468

My guess would be that he wants to ensure the games run on as many versions of Windows as possible, and by including touch support they'd be excluding XP and Vista. Maybe there's also a separate API for Windows 8 touch, I haven't looked too deeply into it.

But as an extension you can activate/desactivate it, or not?
Logged
A child of five would understand this. Send someone to fetch a child of five.
Groucho Marx
Offline (Unknown gender) daz
Reply #12 Posted on: September 30, 2014, 02:33:27 AM
Contributor
Joined: Jul 2010
Posts: 167

View Profile
But as an extension you can activate/desactivate it, or not?
Yes, but one doesn't exist. Someone would have to implement the Windows API calls in GML, or a DLL packaged into the extension. From within GM you can enable extensions per project.

I (and Robert) would like to make an extension for ENIGMA to do it, which are also toggleable.
Logged
Offline (Male) edsquare
Reply #13 Posted on: September 30, 2014, 07:11:29 AM

Member
Location: The throne of ringworld
Joined: Apr 2014
Posts: 402

View Profile
But as an extension you can activate/desactivate it, or not?
Yes, but one doesn't exist. Someone would have to implement the Windows API calls in GML, or a DLL packaged into the extension. From within GM you can enable extensions per project.

I (and Robert) would like to make an extension for ENIGMA to do it, which are also toggleable.

What I meant was : If you implement it as an extension it can be activated/deactivated by the person making the game, so it should not present any problem with your games running on any OS.
Logged
A child of five would understand this. Send someone to fetch a child of five.
Groucho Marx
Offline (Male) Goombert
Reply #14 Posted on: September 30, 2014, 02:50:11 PM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3107

View Profile
Quote from: edsquare
What I meant was : If you implement it as an extension it can be activated/deactivated by the person making the game, so it should not present any problem with your games running on any OS.

Yes that is my plan, I've got the functions outlined and I'll have them done soon, I have tons of LGM stuff to do.
« Last Edit: October 04, 2014, 02:19:50 AM by Robert B Colton » Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Pages: 1 2 »
  Print