• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

windows 10, touchscreen issues

moonbug12

Member
hello i have bought game maker for windows 10, i am trying to make a game i can use on a touchscreen tablet, the issue i am having is windows 10 only picks up a "tap and hold" not a "single tap" or "single hold", does anyone know the correct code for picking up a single touch or hold on a windows 10 tablet?
 

Cameron

Member
hmm never messed with that but if you can setup a counter to count how many frames the screen is being touched for then you can build your own functions to do just that.
 

moonbug12

Member
i find this very hard to understand but i guess going by the documentation, which doesn`t explain it simple that something like this should work

GML:
var tap_count = gesture_get_tap_count()

if tap_count > 0
{
if x > buttonx
if x < buttonx+width
if y > buttony
if y < buttony+width
{
click = true;
tap_count = 0;
}
else
{
tap_count = 0;
}
}
 

chamaeleon

Member
I'm not entirely sure touch handling on Windows works entirely reliable.
Step event
GML:
if (device_mouse_check_button_pressed(0, mb_left)) {
    show_debug_message("Pressed button");
}
if (device_mouse_check_button_released(0, mb_left)) {
    show_debug_message("Released button");
}
Output after single tapping two times on my Surface Pro 4 track pad
Code:
Pressed button
Released button
Pressed button
Released button
double tapping two times (for a total of four touches) on track pad
Code:
Pressed button
Pressed button
Released button
Released button
Pressed button
Pressed button
Released button
Released button
two single tap on touch screen, not getting any successful pressed tests
Code:
Released button
Released button
and finally two double taps on screen (four touches), seemingly reacting as two single tap events but with some extra released statuses
Code:
Released button
Pressed button
Released button
Released button
Pressed button
Released button
Running the same project with the HTML5 target, two single tap on the touch screen seems more logical, giving the same output as using the trackpad
Code:
Pressed button
Released button
Pressed button
Released button
In the end it may not necessarily be a GMS issue in the sense that it is an actual code bug, but perhaps something Windows is doing in an unexpected manner when propagating touch events to the application.
 

moonbug12

Member
chamaeleon
i tried your way but a mouse press is a tap and hold on windows, i know touch works with android and i have bought the windows export, it just doesn't seem that windows is fully supported
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
chamaeleon
i tried your way but a mouse press is a tap and hold on windows, i know touch works with android and i have bought the windows export, it just doesn't seem that windows is fully supported
You are correct. As far as I know, the windows export does not officially support touchscreen input, and never has. You might have more success using the UWP export instead? It should be available to you with your subscription.
 
Top