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 / Problems getting the "-" sign from user input

Author
Message
jomajuga
13
Years of Service
User Offline
Joined: 7th Sep 2011
Location:
Posted: 2nd Dec 2011 01:48
I am trying to develop a PC, Tier 1 text-based game. Everything was good to the point I needed to get the "-" sign from the user. I already managed to get and handle the numbers, Enter, BackSpace and Escape keys from the PC keyboard as theuser inputs a text string. This was accomplished by using the ASCII code of each character I needed. However, the GetRawKeyPressed(45) = 1 statement doesn't work at all...

Does anyone know how to get this "-" sign?
JLMoondog
Moderator
15
Years of Service
User Offline
Joined: 18th Jan 2009
Location: Paradox
Posted: 2nd Dec 2011 02:19
I believe "-" is scancode 11, if that helps. I'll do a quick search over the commands to see if there is a scancode() command.

DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 2nd Dec 2011 02:40 Edited at: 2nd Dec 2011 02:43
I think it is 189 for the - key. At least using the getrawkeystate commands. The ascii code is 45, I have just tested it.

Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 2nd Dec 2011 17:38
I just want to warn you that characters such as - are placed on different keys on different keyboards, depending on the language. It can be quite annoying when games are hardcoded to use an English keyboard when you don't have one.

jomajuga
13
Years of Service
User Offline
Joined: 7th Sep 2011
Location:
Posted: 4th Dec 2011 21:45
Thank you all for your help.

DVader's advice on using 189 was the one I needed to solve my problem... I really appreciate all your help.

Login to post a reply

Server time is: 2024-11-22 19:20:38
Your offset time is: 2024-11-22 19:20:38