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.

DarkBASIC Discussion / How use 2 buttons simultaneously??

Author
Message
Rage
21
Years of Service
User Offline
Joined: 9th Nov 2003
Location:
Posted: 21st Dec 2003 03:06
I'm using scancode() but I don't know how to use 2 buttons at same time

for ex.
when I assign some code to number or letter using Inkey$() and other code using arrows, space, ctrl, etc works fine.

but when I assign some code as scancode()=211 (DEL key)
and I try at the same time use up arrow or space or other code doesn't works.

How I can use 2 keys at same time ?
guru of boredom
21
Years of Service
User Offline
Joined: 12th Oct 2003
Location: middle of no where
Posted: 21st Dec 2003 03:27
try using the keystate command.

if keystate(211)=1 then do something
if keystate(2)=1 then do something else

we are not outnumbered! we are just in a target rich enviroment!
P4 2.4 ghz 120 GB 256 mb GeForce4
John H
Retired Moderator
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 21st Dec 2003 05:11
If you want A and B try

If inkey$()="a" and inkey$()="b"
Print "You hit A and B"
Endif


Dont forget to Join the Forums!
Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 21st Dec 2003 06:22
no, don't think that would work RPGamer...

I am mischeivious
RoooooOoooooKoooooKoooooRoooooOoooooKoooooKooooo!
Slayer
21
Years of Service
User Offline
Joined: 15th Nov 2003
Location: CA
Posted: 21st Dec 2003 06:27
well when you use scancode your asking DB to git the curent key
number being pressed. so if you press A key 30 scan it will give you
30 and if you press A and D you will git the last in your line of code so scan 32. what you need to do is keystate() comand.
if keystate(30)/A and keystate(32)/D = 1 then ________.OK

I dont know how to spell

Login to post a reply

Server time is: 2025-05-22 03:56:21
Your offset time is: 2025-05-22 03:56:21