Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Questions about touch screen detection.

Author
Message
TDavid
11
Years of Service
User Offline
Joined: 7th Feb 2013
Location:
Posted: 1st Feb 2014 11:46
Hi!

My game has been designed to be played with a touchscreen. But it occured to me that some devices might not have a touch screen. With a reasonable amount of work I could make it playable with key inputs. In order to automatically switch to this alternative input setting, I looked for a way to check if the device has a touchscreen or not. Unfortunately I failed to find such a command.

If I read correctly, AppGameKit would generated a mouse cursor if no touchscreen were found. However, in my specific app, that would be really inconvenient.

That's why I came here with 2 questions:
Does AppGameKit support a phone which doesn't have a touchscreen? (Or is there any "touchless" phone on which AGK-made apps work?)
Is there any way to check if the device has a touchscreen?

Thanks for your patience and your help.
Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 1st Feb 2014 12:15
No command to check for touch specifically. I found this: GetMultiTouchExists(). You can also check if keyboard, mouse or joysticks exists.

You can always code in support for keyboard and or joysticks and if the player wants he can use those. That's how I coded my game.

TDavid
11
Years of Service
User Offline
Joined: 7th Feb 2013
Location:
Posted: 1st Feb 2014 13:16
Okay, thanks for your help. I'm going to do as you say.

First, I'll check for hardware joystick and keyboard. If they exist, use them as default input method. If not, I'll enable the touchscreen method.
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 2nd Feb 2014 09:24 Edited at: 2nd Feb 2014 09:26
i have a netbook without touch screen, android 2.3 but it use
a multi touchpad means the mouse instead.
this acer netbook is not a offical supported by google
for my board game at pc i use also the mouse instead of finger touch.

GetPointerX use mouse or touch.
http://www.appgamekit.com/documentation/Reference/Input.htm

AGK 108 (B)19 : Windows 8.1 Pro 64 Bit : AMD Radeon HD 6670
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 3rd Feb 2014 11:43
I don't think there is a way to detect it through a command. I think you have just 2 options...

1. Ask the question when it first loads

2. Work it out from the way the user interaction occurs. If teh pointer seems to move from one point to another without any transition in between, it's a touch screen. If the mouse moves with many points in between, it's a mouse.

Of course, option 2 still isn't perfect. there are other input methods (pen) and of course combined mouse / touch.

Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 3rd Feb 2014 12:55
I'd just assume that if there's a keyboard, there's a mouse and not use touch.

But, I'd just allow both input methods simultaneously.

baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 3rd Feb 2014 16:38
Not sure if it's been fixed but I believe Windows 8 returns a 1 for GetMultiTouchExists() even if the device itself doesn't have it...

oct(31) = dec(25)

Login to post a reply

Server time is: 2024-11-25 01:40:23
Your offset time is: 2024-11-25 01:40:23