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.

Newcomers DBPro Corner / Scancodes. Can they change between computers at all?

Author
Message
Dko
16
Years of Service
User Offline
Joined: 2nd Apr 2008
Location:
Posted: 13th Apr 2008 22:47
I was messing with keystate() and my background in C++ made me wonder if there was any way to make sure that the scan codes always match up with the same key board keys on differnt computers? I don't want to make a great game and all a sudden someone tells me that the keys 'w','a','s' and 'd' don't move the player around but some other random set does. Well thanks for a response in advance.
Ed222
16
Years of Service
User Offline
Joined: 3rd Nov 2007
Location: Calgary
Posted: 14th Apr 2008 00:52
I'm pretty sure pretty sure that all scan codes for computers are the same

Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 14th Apr 2008 01:45 Edited at: 14th Apr 2008 01:49
Quote: "I don't want to make a great game and all a sudden someone tells me that the keys 'w','a','s' and 'd' don't move the player around but some other random set does."

On a French keyboard WASD becomes ZQSD. It's not really much of a problem with control schemes like that (the actual key positions are correct for the scan codes, they just have different letters), the problem arises when you tell the player to press key X which can possibly be a different key on their keyboard. However, in this scenario you can obtain the key name for that particular scan code:



Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 18th Apr 2008 00:04
Yes the scancode will change depending on the language your computer is set to run using.

As an example, look at the dbc game soulhunter. It has an image of the default controls along with the scancode for a keyboard. those code are very different to mine. (Even the ctrl and alt keys are different)

3700+ Athlon 64 - Geforce 7600 GS - 2GbDDR2 RAM - 40Gb Hdd (In this pc) - Windows Vista Ultimate (x86)
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 19th Apr 2008 01:46
Yes, that is true. In fact, its done in the BIOS even before Windows gets hold of it. Nice point, WK.

Login to post a reply

Server time is: 2024-09-27 14:25:30
Your offset time is: 2024-09-27 14:25:30