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 / More keys at a time

Author
Message
MedianHansen
15
Years of Service
User Offline
Joined: 18th Mar 2009
Location:
Posted: 13th Apr 2009 17:17
Well... i have noticed when making a game in DBP, that if i press 3 or more keys at the same time on the keyboard, it will simply ignore th last key/keys pressed. So i would like to know if there's a command to change the maximum number of keys, that can be detected at a time, since this is rather important for my game, as i want th player to be able to use
Walk foward
Strafe right/left
and Jump
At th same time.
feiting shadow
18
Years of Service
User Offline
Joined: 12th Sep 2006
Location:
Posted: 13th Apr 2009 18:02 Edited at: 13th Apr 2009 18:28
google scancode.jpg and save the image to your DBP folder... it helps me a ton.

if scancode(17) then walk_forward()
if scancode(30) then strafe_left()
if " "(31) then walk_backward()
if " "(32) then strafe_right()

should do it. You using inkey$ ? If not, I believe this is an issue with input at the directX, if not hardware level. I've asked this before at gamedev forums, when I used to use DirectX from C.

Signed
------
MedianHansen
15
Years of Service
User Offline
Joined: 18th Mar 2009
Location:
Posted: 13th Apr 2009 19:09
I'm using keystate(Key)
Bursar
16
Years of Service
User Offline
Joined: 17th Sep 2008
Location:
Posted: 13th Apr 2009 20:02
It's probably not a limitation of DBP, but rather one of the keyboard electronics. They tend to only recognise so many keys at once.
DB PROgrammer
17
Years of Service
User Offline
Joined: 9th Feb 2007
Location: Nowhere But Everywhere
Posted: 13th Apr 2009 21:20
Keystate() is the correct way to do it. Bursar is right, it is a limitation of the keyboard, if it's a problem you might just have to buy a new one.

Good luck!


DBPro, limited by the programmer.
MedianHansen
15
Years of Service
User Offline
Joined: 18th Mar 2009
Location:
Posted: 13th Apr 2009 22:04
Well... alright, i thnk ur right, playing other games, i realized that this was global, rather than in just my game! Hpwever, as long as i know it's only a problem for ME, it doesn't matter that much, thanks for the response though!
Allan Hambrick
16
Years of Service
User Offline
Joined: 3rd May 2008
Location:
Posted: 14th Apr 2009 01:24
Google "n-key rollover" for a complete explanation of why this happens. Cheap keyboards are the problem.

Allan
Tobo
19
Years of Service
User Offline
Joined: 12th May 2005
Location:
Posted: 14th Apr 2009 15:11
Bursar has it right, above.

It's probably not a keyboard fault, just the way your particular PC was manufactured.

I know for a fact that my laptop won't read as many keys as my desktop PC.

T
Monk
16
Years of Service
User Offline
Joined: 25th Sep 2008
Location: Standing in the snow =D
Posted: 16th Apr 2009 17:31
I think its the way that the operating system is setup.
My pc starts making all kinda sounds if I try and hold down more than three or four keys at once.

Login to post a reply

Server time is: 2024-11-25 08:21:06
Your offset time is: 2024-11-25 08:21:06