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 / keyboard help

Author
Message
GAM
19
Years of Service
User Offline
Joined: 18th Aug 2005
Location:
Posted: 1st Sep 2005 08:40
i need help with something...i dont want to use the UP, DOWN, RIGHT, LEFT keys...but i want to use the WASD keys...can someone help?

just edit this into the WASD keys:
if upkey()...
if downkey()...
if leftkey()...
if rightkey()...
just remake this little code with the WASD keys, thats all i need.

The Power of One:
-Game=9%
-Online Game=72%
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 2nd Sep 2005 08:22
It's best to use keystate.



The attached image shows the keystate of each key. I got it from here but I don't remember who posted it (sorry whoever you are).

Attachments

Login to view attachments
Rikimaru
19
Years of Service
User Offline
Joined: 31st Aug 2005
Location: England
Posted: 2nd Sep 2005 11:21
Alternativly, if you want to use the WASD keys to move your character / camera / object around the world use the "scancode"



I have the full list of scancodes for each key on the keyboard in a .txt file which I will post as an attachment later today, I am not at my own computer and so do not have the .txt file at hand, sadly it seems to take a few hours for each post to make onto the forums, so my next post may only appear tomorrow.

I hope this will help you, and if all you need to do was print the word w then listen to the post before me from Grog Grueslayer.

"Death is but an escape chosen by those who dare not live. I merely emancipate their souls." - Shadowblade, Master of Assassins.
Rikimaru
19
Years of Service
User Offline
Joined: 31st Aug 2005
Location: England
Posted: 2nd Sep 2005 18:42
Ok he's that .txt file of all the scancodes for the keyboard (it's an attachment.

also here is the code I have used to move the camera around in my 3D world
it's ready to be copied and pasted into DBP, just remember to close the loop with the loop command.

Also if it is not your intention to move the camera around a 3D world ignore everything I have said... :S

"Death is but an escape chosen by those who dare not live. I merely emancipate their souls." - Shadowblade, Master of Assassins.

Attachments

Login to view attachments
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 3rd Sep 2005 00:07 Edited at: 3rd Sep 2005 00:09
Quote: "I hope this will help you, and if all you need to do was print the word w then listen to the post before me from Grog Grueslayer."


The printing of the keys was just to show each key is working. I expect him to delete those lines and add whatever he wants. This may be a shock to you... but code can be changed.
Rikimaru
19
Years of Service
User Offline
Joined: 31st Aug 2005
Location: England
Posted: 3rd Sep 2005 00:49
Hey Grog, Sorry I ment no offence, honest, I thought you were just telling him how to display the letters that's all.

Honestly I didn't mean to insult you or your in anyway, sorry again

"Death is but an escape chosen by those who dare not live. I merely emancipate their souls." - Shadowblade, Master of Assassins.
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 3rd Sep 2005 22:30
It's ok. I wasn't offended. I used to be a newbie too... in some ways I still am.

I do need to tell you about your use of scancode(). I used to think (like you) that scancode() could be used in that way. But scancode() is designed to only inform the programmer of what numbers are assigned to what keys. It is not meant to be used as a way to check for input keys. The main reason is because it will only return the lowest number currently being pressed. If you press two keys at once (like a and q) it will only show (q) as being pressed because the scancode for (q) is 16 and (a) is 30.

Try pressing more than one key with this code:



Keystate() is designed to be used to check for keys. Here's what the help file says about keystate():

Quote: "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)"


Notice above how the syntax says KEYSTATE(Scancode)... as in the scancode found out with the scancode command. When you use keystate you can check for multiple keys being pressed.

So it's best to do this:

Rikimaru
19
Years of Service
User Offline
Joined: 31st Aug 2005
Location: England
Posted: 4th Sep 2005 13:02
ahh, brilliant, that's why using the scancode for the shiftkey instead of using the "shiftkey commnd" doesn't let you run... I understand now, thanks for the advice

"Death is but an escape chosen by those who dare not live. I merely emancipate their souls." - Shadowblade, Master of Assassins.
GAM
19
Years of Service
User Offline
Joined: 18th Aug 2005
Location:
Posted: 4th Sep 2005 21:52
hey...thanks to everyone...but i think Grog Grueslayer gave me the easyest and most effective help for me...thanks Grog Grueslayer

The Power of One:
-Game=9%
-Online Game=72%

Login to post a reply

Server time is: 2024-09-24 03:23:15
Your offset time is: 2024-09-24 03:23:15