Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [keyboard]

Often the primary input for computer games. It boasts a very large versatility for direct input.

0
votes
0answers
26 views

Key presses are not responding well

The key presses are responding once, then doing the automatic key presses. The code is below and you can see what it does below that. ...
0
votes
1answer
33 views

Custom mobile keyboard in unity

I'm trying to create a falling word typing game like z-type. I have used the code provided here — but it's is only for keyboards: ...
1
vote
1answer
90 views

What is the difference between a hotkey and a shortcut-key in a game?

I was wondering: What is the exact difference (if there is any) between a hotkey and a shortcut-key in a game? Some games for example allow the player to bind certain actions to a specific key and ...
3
votes
1answer
62 views

How to identify individual keyboard keys across devices from different locales

I'm trying to make a UI system that adapts images for key binding depending on the keyboard type (azerty/qwerty/etc). For the moment I've done the binding with DirectInput Key Codes so it does not ...
0
votes
2answers
189 views

SDL/C++ Keyboard Input

I'm having trouble with key management. Movement works fine but the shooting does stuff that I don't want to happen. Every time I press the arrow keys to shoot it works fine but when I press a key ...
0
votes
1answer
45 views
0
votes
1answer
19 views

My sprite is not listening to any keyboard keys

First time ever creating html canvas game. Once I finally got my sprite ant tiles drawn on the canvas, now I want to make my sprite interactive. Unfortunately, for some reason it is not working. I get ...
0
votes
1answer
45 views

Java: refresh KeyInput to avoid sticky fingers during gameover state

In short, I am trying to avoid my keys from sticking when its in the gameover state. The problem is if the player is holding down the right button for instance and dies, then he restarts the game ...
1
vote
0answers
280 views

pygame KEYUP KEYDOWN events only once per frame?

I've been playing around with pygame, and I ran into a bit of an odd issue with input on the pygame event queue. Consider the following test code: ...
1
vote
0answers
49 views

Default movement keybindings for roguelike?

I'm developing a text based MUD, but unlike MUDs I'm developing without telnet and making a custom interface. Think Caves of Qud or Dwarf Fortress. The game only has 6 directions you can walk. ...
4
votes
1answer
252 views
3
votes
1answer
174 views

Why do I have delays when pressing a keyboard key continuously to move the character?

What happens is I press right for a fraction of a second then release and my character moves to the right, as it is supposed to. I then press right again but this time for 5 seconds. My character ...
1
vote
1answer
146 views

How can I process extra mouse buttons using Monogame?

I use Monogame for game development. For processing mouse input, I can use the Mouse class to query basic information like left click state, right click state, and ...
0
votes
1answer
546 views

Pygame set_repeat() issue

I want a single key press to result in the sending of one event in my game loop. As a toy example, if the player presses and holds LEFT, I want the sprite to move 1 pixel left and then stop until the ...
1
vote
1answer
108 views

Handling of persistent key presses in an ECS

I'm currently in the planning phase of a game. The whole thing should be based on the entity-component-system (ECS) pattern. All logic is concentrated inside of the systems, i.e. that the components ...
1
vote
0answers
224 views

Detecting keys presses between keyboard layouts, operating systems and javascript

I've recently encountered a few headaches when I tried to detect key presses for a custom game engine to supports Windows, MacOS, Linux, and WebGL. Naive approach: At first I naively thought that ...
2
votes
1answer
66 views

How to handle keyboard controls in Arkanoid game

I'm making simple Arkanoid clone in Unity with both keyboard and mouse controls available. When I gave it to my colleagues to test one complain was that keyboard controls are not precise enough,. The ...
0
votes
1answer
481 views

How can I use keybord keys like W, A, S and D in GLUT and C++?

I want to use W, A, S and D keys like GLUT_KEY_LEFT. My Code: ...
0
votes
1answer
48 views

Unity Deactivating Keyboard Input Interpolation

I'm working on a game in Unity, and it is a little jarring to use with keyboard controls. I'm using the built in Input Manager, where I have a set of axes mapped to the left and right keys. When the ...
1
vote
1answer
264 views

SDL2.0.5 - SDL_KEYDOWN shows two identicle presses when only one key is pressed

SDL2.0.4 using this code: ...
1
vote
1answer
69 views

How can I enhance this keyboard handler class (remove global variables)

I would like to enhance my keyboard class to be more tight and encapsulated. The first issue I've addressed is Singleton design pattern. I've done this as follows: ...
1
vote
2answers
426 views

Handling keyboard input in SDL2

I'm using SDL2 with .NET bindings. Keyboard handling is encapsulated in static class, and keyboard handling code part looks like this: ...
4
votes
1answer
189 views

How to handle complex inputs in 2D platform game?

I am trying to add keyboard control for my character in 2D platform game with JavaScript. The character can walk, dash and jump. Here is my current code: ...
0
votes
1answer
32 views

Need help solving EventHandler issue

I have an issue with my EventHandler for Key events in my game. The specifics are in this forum thread: http://www.java-gaming.org/topics/problems-with-key-event-handling/37998/view.html Basically, ...
1
vote
3answers
1k views

Continuously get keyboard input from user and remember last character [Java]

I want to write a Snake game in Java. How can I continuously monitor input and if user pressed W set variable ...
0
votes
2answers
2k views

Input.GetKeyDown need to press button more than once to work

So in Unity3D I'm checking for Input.GetKeyDown(KeyCode.E) for stuff like pickups and opening doors. Sometimes it doesn't work the first time I press it and I must ...
1
vote
1answer
94 views

Timing in holding LWJGL keyboard event

I'm using LWJGL to develop a 3D game. I'm having trouble with my keyboard handler. My aim is to implement the function which is holding Space then release it to trigger an increasing of the velocity ...
2
votes
2answers
266 views

Can't move rectangle constantly with key down

I can only move the rectangle every time I push a key down. How would I continuously move my shape when the key is down? Here's my code: ...
1
vote
0answers
155 views

Get modified key with SDL2

If I poll keyboard events with SDL2 all I get is the pressed key and the modifiers. But I am using Neo and have some keys like Esc and arrow keys on a different layer which means that e.g. ...
0
votes
1answer
84 views

Managing left and right direction buttons being pressed at the same time

I am currently programming a Tetris clone. In Tetris, there is a system being used called DAS, or Delayed Auto Shift. It works similarly to the keyboard auto-repeat used in Windows. For example, if ...
1
vote
1answer
363 views

How to handle keyup events in game loop?

I'm writing a simple game in JavaScript, which already handles basic keyboard input like so: ...
0
votes
1answer
170 views

Game optimization and keyboard events

I've been putting some (a lot) of thought about how to read keyboard input and especially, when. Looping through all the keycodes on the keyboard and updating the statuses seems like a lot of waste ...
0
votes
1answer
269 views

How to get status of LEDs on keyboard and blink LED on keyboard from Unity 3D on Android?

On Android, with Unity how do I get the status of caps lock, scroll lock and num lock LED's and blink these LEDs for caps lock, scroll lock and num lock from Unity 3D? Blinking the LEDs will of ...
0
votes
5answers
746 views

What keys should I use for a four-player game with one keyboard?

I'm planning on making a multiplayer game for up to four people on a single machine. We want to have all input coming from players using the same keyboard (or multiple keyboards connected to the same ...
1
vote
1answer
1k views

Correctly creating/handling events for keypress in MonoGame C#

I'm having trouble finding the best approach to registering an instantaneous user key-press with MonoGame (where the key has been held down and then released), using events in C#. Unlike the click of ...
2
votes
1answer
381 views

KeyCode dictionary in Unity

I found a strange problem while programming keyboard input in Unity (v5.3.5). ...
11
votes
2answers
3k views

Removing delay at start of a key press

I'm making a simple game, and one of the problems I encountered is the annoying delay when pressing a key continuously. So basically, when I press (for a very long time) for example Up, my object ...
0
votes
1answer
517 views

How do I fix a delay between the first and second KeyEvent

I recently got really interested in making my own little game. As I have no real game development background I'm still figuring stuff out, but I encountered a little problem. While working on the ...
1
vote
1answer
525 views

SDL2 SDL_PollEvent endless polling on key hold

What is wrong with SDL2 SDL_PollEvent() function? When I press-and-hold a key it enters "while (SDL_PollEvent())" block each frame. If in previous frame event queue was emptied and in new frame I ...
1
vote
1answer
467 views

How to handle two players playing on one keyboard with Box2D (LibGDX)?

I'm making a racing game with LibGDX and Box2D. I've been using this tutorial to implement the basic physics, and it works properly. My main problem is to implement two different sets of keys (UP-...
0
votes
1answer
359 views

Simulate Keyboard Button Press [SDL Library]

I am trying to simulate an SDL keyboard button press (using C). I have looked up the SDL info pages online but I still don't have anything that consistently works. I have the following (removed the ...
0
votes
3answers
331 views

Get pressed character in LWJGL (Ignoring modifier keys)

I have a basic text field setup in LWJGL, however pressing any modifier keys (Shift, F1-19, Page Up, etc.) inputs a space into the text field. How would I ignore those characters? Here's some code so ...
0
votes
3answers
3k views

Problem with Input.GetKeyDown to set a counter in Unity: multiple values in only one pressing

Using Unity 5, I want to use have one keyboard key ("f") increase a counter when pressed. It means, using Input.GetKeyDown("f") function in a way that: if "f" is pressed when the counter=1, then the ...
1
vote
1answer
2k views

Change key setting from qwerty to azerty in Unity

How can I change the default key for walking with the player in Unity. At this moment I can do this with A, W, D and S (or something). But because I work with an azerty keyboard, I'll change it to Z, ...
0
votes
1answer
157 views

Competing keyboard events

When I was looking on how to handle key inputs in a game loop I came across the following pattern: All native key events (up or down) get queued in an event queue that is later processed. The outcome ...
4
votes
1answer
563 views

In GLUT, how do I bind an action to a press of “any key”?

Well, this sound ridiculous but the logic is escaping me. I have drawn my cube in OpenGL and I want to translate it to the right if any of the key on the keyboard is pressed. I know how to do this for ...
6
votes
3answers
1k views

How do I accept only one directional input per update?

I'm coding "Snake" as my first game and I'm facing the logical fail when pressing multiple keys simultaneously eg. { up, right}; {up, left}; {down, right}, etc. Snake is able to go back and forth and ...
1
vote
0answers
97 views

What is a simple way to pull input from a keyboard and attach it to a std::string?

The question says it all to be honest. I have a game that I am making in Ogre3D, using OIS as the main input library. My issue is that I am attempting to use CEGUI (with tons of errors) all to simply ...
1
vote
1answer
49 views

Indicate key options in a keyboard-only game

I am creating a music-based app for one of the courses I teach at a high school, so it's not for sale in the app store, it's only for my students to use. I decided to make it keyboard only partially ...
3
votes
1answer
470 views

LibGDX: How to detect remote button press for Android TV?

On Android TV, I need to be able to detect the remote control centre button to start the game. I tried: ...