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 / press a specific keyboard button/clear screen, etc.

Author
Message
adam62385
20
Years of Service
User Offline
Joined: 14th Apr 2004
Location:
Posted: 24th Apr 2004 05:37
I'm writing a program where you have to press either the 1,2,3, or 4, and then a different message is supposed to display according to each different button press.

How would I go about this? Programming the keyboard has ALWAYS been rather difficult for me. I think this'd have something to do with scan codes, but not positive... and if I'm right, how to make this work. Help would be appreciated.

Thanks!!

Adam
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 24th Apr 2004 06:11 Edited at: 24th Apr 2004 06:12
you could use keystate() function which requires the scancode as a param

here's the scancodes


KEYSTATE
This command will return an integer value of one if the key specified by the scancode is pressed, otherwise
zero will be returned. The scancode value is the raw value assigned to the key of the keyboard device and
very often is ordered sequentially from the top left of the keyboard to the bottom right.

SYNTAX
Return Integer=KEYSTATE(Scancode)


Home of the VB.NET Class Builder Utility - Demo and FULL versions now available!!
adam62385
20
Years of Service
User Offline
Joined: 14th Apr 2004
Location:
Posted: 24th Apr 2004 18:07
I appreciate it, cattle rustler, and I thought the keystate would work too, and it probably WILL, however.... since this is totally text based, I've thrown in a bunch of wait keys to hold my screens and.... well..... I'll go ahead & show you the code.
I don't have a wait key command thrown in this bit of code, no... but when it gets down to that very last print command, it's like you don't even see it, and the program ends. better yet... if you like, I can send you the full executable as far as I've gotten through email.
Emperor Baal
20
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 24th Apr 2004 19:51
replace the last print command,
print "to choose your clan, fledgling, press a number 1-4"

with this:



Quote: "
UPDATED

Amd 2800+ 1024mb pc3200 A7N8X - Deluxe Ati Radeon 9800PRO 256mb
"
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 24th Apr 2004 21:40
ya Input
missed that.


Home of the VB.NET Class Builder Utility - Demo and FULL versions now available!!
Neofish
20
Years of Service
User Offline
Joined: 7th Apr 2004
Location: A swimming pool of coke
Posted: 25th Apr 2004 01:16
if u dont have that chart to hand use this to tell you the scancode:



Login to post a reply

Server time is: 2024-09-22 06:44:18
Your offset time is: 2024-09-22 06:44:18