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 / inkey$ trouble

Author
Message
andycb
16
Years of Service
User Offline
Joined: 12th Jan 2008
Location:
Posted: 6th Feb 2008 21:13
I don't know if anyone else is having this problem but if i use the inkey$ command then it only registers if one key is pressed. So if I were to press "w" and "d" at the same time DBPro would only register the last key to be pressed and so stop doing what ever i had told it to do if the first key was pressed.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 6th Feb 2008 22:17
That's how INKEY$ works.

If you need multiple keys to be detected at once, you'll need to use the KEYSTATE function to check them. Unfortunately you need to use keyboard scancodes to check the keys pressed - each key has a unique number from 1 to 255 allocated to it - luckily, someone will probably soon appear and post a link to a graphic of the keyboard layout with scancodes...

LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 6th Feb 2008 22:43
Attached is a graphic of the keyboard with scancodes that I got off the forum a while back.

LB

Attachments

Login to view attachments
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
andycb
16
Years of Service
User Offline
Joined: 12th Jan 2008
Location:
Posted: 7th Feb 2008 17:36
Thanks IanM I hadn't heard of the keystate function before and thanks LBFN for the graphic of the scancodes
Ed222
17
Years of Service
User Offline
Joined: 3rd Nov 2007
Location: Calgary
Posted: 9th Feb 2008 01:45 Edited at: 9th Feb 2008 01:47
Heres a program to find the scan code faster or just use this code
now after you find the scan code this is how use use keystate


Windows Is better than everything

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-11-25 07:44:39
Your offset time is: 2024-11-25 07:44:39