Tag Info

New answers tagged

2

Let's assume we have button A and button B and you want to be able to press both of them but not in the same frame. The general way of accomplishing this is the following: on button A key press if button B is currently pressed execute action end on button B key press if button A is currently pressed execute action end combining ...


10

Keyboards have a key matrix, where the buttons have been arranged into something roughly square, with the keyswitches each being tied to one row and one column. The keyboard activates each row and then reads the columns. If you sketch this out you will see that some button combinations must activate "phantom" keys. You can fix this with one diode per button ...


17

Keyboards have hardware limitations on how many keys can be pressed and recognized at the same time. Your code is not the problem here, it's most likely the design of the keyboard.


0

It can be useful for driving/simulation games where walking and driving controls may be different. I.e. Battlefield games. When walking on foot you may use a keyboard. When flying you may use a joystick. And like someone else has mentioned, if you have alternative input devices, you don't want to remap or reload your configuration, you want to have ...


1

These help in situations where a certain control scheme is easier to use than another. It's especially useful if you can map some action to a key and a mouse button at the same time. You can map movement and jumping in an FPS to the extra mouse buttons and use the other hand to eat pizza! It's even more useful if you can map both to the keyboard/mouse AND a ...


1

I think the best argument for secondary controls is probably for when you're already using all "maxing out" the input on one of your hands. For instance, in a FPS, you might want to move diagonally, while sprinting, jumping into a crouch, and then doing a quick melee attack. In this instance, it might be easier to use MOUSE3 than V. The opposite goes if you ...


0

I have one primary answer to your question, but first a few thoughts: There seem to be two forces you have to balance between with commands; helping a new user by supporting more natural and less idiomatic syntax, and helping minimize growing frustration with long/expressive syntax. Prepositions can be really useful, because you can have a short list of ...


0

I think you are going at this the right way. Always keep in mind the English grammar (predicate, object) with adjective in between. If a second sentence is concatenated with "and" you have to re-run the parser again. I would implement much more verbs, objects and adjectives than are used in the game. That way you can recognize the sentence structure even if ...


1

I'm pretty sure you'll find it impossible to support multiple keyboards. This thread about multiple keyboards support for SDL indicated it was impossible, and pygame is at heart a python wrapper for SDL. Furthermore I believe it uses SDL 1.x not SDL 2.x, so it hasn't been actively developed for a long time. I'm not aware of any limits to the number of ...


1

sizeof(_curKeys)/sizeof(Uint8) does not give you the size of the array, because it's just a pointer from compiler's point of view. Instead of passing NULL as an argument to SDL_GetKeyboardState();, pass a pointer to an integer and the function will write the length of the array to that integer. See documentation. Use that value for both allocating _oldKeys ...


0

Ah, it's a new bug in Gamemaker Studio. The string functions don't work whilst in fullscreen, but if I start in windows mode, it works fine.



Top 50 recent answers are included