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 / Multiple simultaneous key input

Author
Message
Dixan Anips old
21
Years of Service
User Offline
Joined: 3rd Nov 2002
Location:
Posted: 3rd Nov 2002 20:36
Can anyone help me out with this?

I'm trying to move a camera using keyboard input i.e. cursor keys and would like to be able to use a combination of up/left etc to move diagonally.

I've tried inkey$() and scancode() in my main loop but each keypress seems to cancel out the other.

Is there a way of getting both key presses simultaneously?

TIA
Zenders
21
Years of Service
User Offline
Joined: 4th Oct 2002
Location:
Posted: 3rd Nov 2002 22:21
use keystate() rather than those two

for instance, if the scancode() that you wanted to get was 2 ("1") then use

if keystate(2)=1

Hope this helps

Dave

Zenders
21
Years of Service
User Offline
Joined: 4th Oct 2002
Location:
Posted: 3rd Nov 2002 22:21
keystates dont cancel each other out, btw (In case you hadn't guessed)

Dave

Dixan Anips old
21
Years of Service
User Offline
Joined: 3rd Nov 2002
Location:
Posted: 3rd Nov 2002 23:21
Great stuff Zenders (Dave

Thanks for the help

Login to post a reply

Server time is: 2024-03-01 03:50:32
Your offset time is: 2024-03-01 03:50:32