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 / the alternate key

Author
Message
kfoong
21
Years of Service
User Offline
Joined: 28th Jan 2003
Location: Australia
Posted: 18th Mar 2003 10:03
Does anyone know how to do the alternate key?
i.e control key is controlkey(), up key is upkey() etc.
Someone help me please
--------
http://www.stellarblue.vze.com/
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 18th Mar 2003 20:38
Use scancode() to get the keys without the special functions.

Use this to get the value of each key (except escape):

IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 18th Mar 2003 20:38
Oh, it's SCANCODE(56) by the way!
John H
Retired Moderator
21
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 18th Mar 2003 22:58
IanM always beating me to the helping But yes, use scancode. Simply use that code, press the key, then use that number in the KEYSTATE(x) command.

RPGamer

Current - RPG: Eternal Destiny
http://www.halbrosproductions.netfirms.com
Dont ask those questions! Read the help files lazy! Oh ya, and Tat has a plugin for that!
kfoong
21
Years of Service
User Offline
Joined: 28th Jan 2003
Location: Australia
Posted: 19th Mar 2003 10:12
thanx

--------
http://www.stellarblue.vze.com/
Megaman Zero
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: United States
Posted: 19th Mar 2003 20:13
Ive been wanting to know how to do that too, but I have a question about it. the line...

print scancode()

Does that print it on the screen or just in memory for further use? Or is this where I find out which scancode that is? I am wanting to rework the up, down, left, & right keys to w, s, a, & d keys, & I have been trying to figure out the scancode command for some time (they had something similar in Rad, but I could never figure out how to use it.)

Also, in the documentation, is there a scancode reference for all of the scancodes? If not, is there an online tutorial?

Thx,

IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 19th Mar 2003 20:46
Um, I don't know whether to answer or not - might upset RGGamer even more

What the heck ... it writes to the screen.

The scancodes are easy enough to figure out with the code I gave you, but someone did post a graphical layout here somewhere ... or put 'keyboard scancode' into google.
John H
Retired Moderator
21
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 19th Mar 2003 22:34
run this code
Do
Cls
Print scancode()
loop

And press any key, look in the upperleft and VOILA! Its your scancode key

RPGamer

Current - RPG: Eternal Destiny
http://www.halbrosproductions.netfirms.com
Dont ask those questions! Read the help files lazy! Oh ya, and Tat has a plugin for that!
Megaman Zero
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: United States
Posted: 20th Mar 2003 07:33
And when I get the scancode, I use the KEYSTATE(x) & I put the scancode number in the place of the X, right? If thats true, then I think I can make sense of it now.

Thx,

John H
Retired Moderator
21
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 20th Mar 2003 14:17
Yep

do
cls
scancode()
loop

And then you press Q the result will print 16. Then, just say

if keystate(16)=1 then end and if you press Q, your program will end

RPGamer

Current - RPG: Eternal Destiny
http://www.halbrosproductions.netfirms.com
Dont ask those questions! Read the help files lazy! Oh ya, and Tat has a plugin for that!
Megaman Zero
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: United States
Posted: 21st Mar 2003 10:31
Ok, great, thanks for all the help, it has really been helpfull. I will now try & copy all of the posts on this topic to a text document.

Thanks again,

punkin111
21
Years of Service
User Offline
Joined: 16th Mar 2003
Location:
Posted: 21st Mar 2003 19:19
I Have been trying to figure out this also.... Does the scancode work for the arrow keys. ie; down arrow, cube goes down left arrow left and right arrow goes right... using the functions stated? I was working on it last night and had everything I could find in the tuts about this except scancode( i left it out thinking it was for something else in that specific code) anyways nothing happened when i added the stuff so Ill have to give scancode a try anyways .

Login to post a reply

Server time is: 2024-09-20 01:15:40
Your offset time is: 2024-09-20 01:15:40