Keyboard Problems
Blitz3D Forums/Blitz3D Beginners Area/Keyboard Problems
| ||
Hi. I'm making a multi-player space game and my only problem so far is the keyboard input. If the other player is holding down 4 keys or more then I can't control my ship because the keyboard only lets you press four keys at a time. It also makes a beeping noise even when the volume is muted. Is there a way to get more than four inputs from the keyboard at once? |
| ||
From my experience of trying to play two player games on "neopets.com" years ago with one keyboard, it's impossible. |
| ||
Ok. I guess I'll have to make it one-player although two player would be a lot more fun. |
| ||
This is a hardware limitation - nothing to do with Blitz. The beeping noise is your PC's internal speaker pleading for mercy on behalf of the motherboard. Forget the keyboard and add gamepad support. |
| ||
Hi try this code While Not KeyHit(1) Cls KeyList$="" KeyCount=0 For i = 1 To 255 If KeyDown(i) Then KeyList$ = KeyList$ + i +", " KeyCount = KeyCount + 1 End If Next Text 10,10,KeyList Text 10,30,KeyCount Flip Wend End The beep, signals that the Keyboard Buffer is full. This happen when the keystrokes arrives faster than they leave. In the above code, all the possible codes are tested, even if there are more than one, the second parameter says how much keys were detected in each loop. Juan |
| ||
i remember an old dos game that had 4 or so players on one keyboard, that would be cramped wsas olk; cursor and 5213 on the numpad or something similar and i thought it was bad playing splitscreen games |
| ||
I guess I don't have any options but to use the joystick or the mouse. @Charrua I have one more question though. Why does it let you input five numbers with certain combonations of keys, and only three with others? |
| ||
God question! In my machine I get 10 key simultaneusly (and I have no more finguers!) pressed, but, on some combinations only 6 or 5. I only try a few... and you probably encounter that the combination you plane to use, don't work. The normal keyboard handler (sure not the one blitz uses) support one "ascii" key (say a, b, 1, 4, etc) and any combination of Shift, Alt, Ctrl. So at first I agree with Gfk. As always, there is a gap between the practice and the theory. So we have to try. Juan |