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 / DBP Scancodes the same as DInput and WinAPI scancodes?

Author
Message
Da_Rhyno
13
Years of Service
User Offline
Joined: 25th May 2011
Location:
Posted: 17th Oct 2011 06:09
Are DarkBASIC Pro keyboard scancodes the same as DirectInput and WINAPI scancodes?

Just a quick question.
Darkzombies
13
Years of Service
User Offline
Joined: 25th Dec 2010
Location: In multiple tabs, most likely youtube.
Posted: 17th Oct 2011 18:32
I dont know, never used it, but pretty much each keyboard key has a scancode. Im pretty sure you can look it up, theres 2 types, one means releasing the key, one means pressing the key. Just do...



Thats the X key.

"Insert funny coding-related joke here"
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 17th Oct 2011 18:45 Edited at: 17th Oct 2011 20:34
It's best not to use SCANCODE() for detecting keys though (it works best as a command to check for no keys being pressed). It only returns one key at a time and only shows the lowest numbered key being pressed. KEYSTATE() allows us to use more than one key at a time. The limit is actually hardware because certain keyboards allow more and some allow a max of only 4 keys at a time.

Here's my keystate map.


IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 17th Oct 2011 21:06
Quote: "Are DarkBASIC Pro keyboard scancodes the same as DirectInput and WINAPI scancodes?"

They are DirectInput scancodes.



Login to post a reply

Server time is: 2024-11-22 12:14:13
Your offset time is: 2024-11-22 12:14:13