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

learn more… | top users | synonyms

1
vote
5answers
112 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
41 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
2answers
365 views

Multiple keys being pressed, some being ignored SDL

I'm making a two player pong clone and my problem is that when the second player presses both of his/her buttons at once, the first player locks up and cannot move, even though this does not happen ...
1
vote
1answer
143 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: if (Gdx.input.justTouched() || Gdx.input.isKeyJustPressed(Input.Keys.SPACE) || Gdx.input....
1
vote
1answer
96 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-...
1
vote
1answer
50 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 ...
-1
votes
0answers
11 views

Rectangle Flash fix and draw string

Now I have a code which works :) But now I have 2 bugs and I don't know how to fix it. I am drawing a rectangle (that works) but it's flashing and I dont know why. The second bug is i did a score int ...
0
votes
1answer
49 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
30 views

KeyCode dictionary in Unity

I found a strange problem while programming keyboard input in Unity (v5.3.5). public class AvatarInputMapperUnityContext : MonoBehaviour { private AvatarController _avatarController; public ...
11
votes
2answers
1k 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 ...
2
votes
3answers
644 views

LibGdx TextField - Hide Keyboard when not focused - How to?

I'm creating a registration screen for my game. I implemented textfields and input is getting correctly. But when I click elsewhere after text is entered, the keyboard stays visible and does not hide ...
0
votes
1answer
59 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
429 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 ...
0
votes
3answers
94 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
1answer
265 views

Change key setting from qwerty to azerty in Unity

How can I change the default key for walk with the player in Unity. For this moment I can do this whit A, W, D and S (or something). But because I work whit an azerty keyboard, I'll change it to Z, Q, ...
3
votes
2answers
178 views

How can I support remappable controls?

I am trying to allow players of my game to remap the controls (eventually from the menu). Currently, some of the buttons have been defined, but they can't be changed. They are hard-coded. For example, ...
3
votes
1answer
105 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 ...
0
votes
1answer
39 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 ...
1
vote
1answer
41 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 ...
6
votes
3answers
964 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 ...
6
votes
2answers
3k views

How can I forward GLFW's keyboard input to another object?

I'm having trouble trying to execute keyboard events in a another class with GLFW3. The problem I'm having is that GLFW3 uses a static function for input as shown: static UI u; ... ... static void ...
1
vote
0answers
51 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 ...
0
votes
1answer
176 views

Missing keyup event

I have a pretty generic input class. In the main app, I forward an event to the game. The game an input object that manages Keyup and Keydown presses. It stores the keys pressed in a vector<key&...
-2
votes
1answer
71 views

single Key press [duplicate]

I have my following (static) KeyListener http://pastebin.com/gR1i3Xzb and this is my update Method: @Override public void update() { input(); /*...*/ } private void input() { ...
1
vote
0answers
64 views

Custom Keyboard run by Arduino not working in XNA

I'm trying to make a stenotype-teaching game using the stenoboard as input. The Stenoboard emulates an NKRO keyboard, using this code: https://github.com/caru/StenoFW/blob/master/StenoFW.ino, with an ...
0
votes
0answers
42 views

Acceptable latency for keyboard input

What is the acceptable latency for keyboard input? acceptable here means that a person doesn't notice the lag even subconsciously? For me the responsiveness of the interface is critical for a good ...
1
vote
0answers
130 views

Unity: Finding out where OnSelect comes from

The new UI EventSystem method OnSelect is called from a number of different sources. One is when the Selectable is selected by using the arrow keys to navigate. Another is when clicking on the ...
1
vote
1answer
138 views

Keyboard input vs character movement encapsulation

In our game created with c++ and sdl we are having difficulty delegating how the main character should be controlled. We have a keyboard class and a sprite class for the main character, but are ...
9
votes
5answers
10k views

Handling keyboard and mouse input (Win API)

There is a number of ways to catch mouse or keyboard under Windows. So I tried some of them, but every of them has some advantages and drawbacks. I want to ask you: Which method do use? I've tried ...
1
vote
3answers
3k views

how to detect same keyboard key press only once

I am designing a keyboard class that can detect the keyboard key press only one time but I still cannot figure out the way to do it. My goal is just check and perform the action only once when the ...
0
votes
0answers
35 views

Problem with keyListener

I have written some code that makes a labyrinth,and fills the JPanel with my figures (Wall, Player, Road and Gate). I want to move the player with WASD, so I have written the following code. The frame ...
5
votes
2answers
5k views

How do I read input from multiple keyboards/mice on one computer?

I want to be able to read inputs from multiple keyboards and still differentiate them. It's for split-screen. I know it's possible, because Serious Sam 3 allows it. Edit : Well a whole lot of my ...
0
votes
3answers
537 views

How can I access LWJGL's Keyboard from a thread other than the graphics thread?

I'm loving LWJGL, but have been running into a number of odd problems with it. Most of it seems to deal with the fact that OpenGL is a state-machine and was only ever meant to be accessed from a ...
2
votes
2answers
2k views

LWJGL multiple keyboard/mouse input checks

As in many game libraries such as LWJGL, you can check mouse/keyboard events with Mouse.isButtonDown or Keyboard.IsKeyDown. I want to check for button/key presses, not if it's currently pressed down (...
2
votes
5answers
6k views

RPG movement holding down button

I've been writing a simple top down mini RPG in python. My problem is that when I move the player I have to repeatedly tap the arrow key. Each time I tap the key the player moves 5 PX in the ...
1
vote
2answers
101 views

Standard key bindings for movement along three axes?

I understand that the WASD keys are standard for moving a character along two axes (left/right, up/down) because in the QWERTY layout, they are arranged like the arrow keys. I want to make a game ...
1
vote
1answer
181 views

Reference keyboard keys as “justPressed”, “pressed”, and “justReleased” with SDL in C++

I'm teaching myself 3D graphics with OpenGL and SDL in C++. I'm at a point where I need to be able to query states of individual keys, like so: if (InputManager::justPressed(SDLK_UP)) {} if (...
2
votes
1answer
80 views

How does XNA's KeyboardState represent all keyboards?

I already understand how to work with Keyboard and KeyboardState, but when debugging I happened to take a look at the KeyboardState's non-public members via the VS debugger. I expected to see a large ...
3
votes
4answers
1k views

Key mapping for a 2-players game

I've been struggling for a while trying to figure out the best way to map two players on a single keyboard. Let's consider something generic: Arrows Validation Cancel (optional) Some common actions ...
11
votes
2answers
1k views

Portable buffered keyboard input for XNA / MonoGame?

As a preliminary solution, I am currently using the Nuclex framework in an C#/XNA game project for buffered keyboard input. Sadly, nuclex relies on SlimDX.Directinput.dll and therefore to my knowledge ...
4
votes
3answers
710 views

SDL Multiple keyboard support

I am making a game with multiplayer split screen mode using SDL. Basically, I like the idea of having each player plug in his own keyboard to the PC, set custom controls via options and being able to ...
0
votes
1answer
179 views

Checking whether a specific key was pressed in enchantJS

I am using enchantJS and would like to use the letters and numbers as well as numpad on a keyboard to do different things (eg: hotkeys). From this page http://users.csc.calpoly.edu/~foaad/enchant/...
0
votes
2answers
4k views

Detecting key press only once in Libgdx [duplicate]

Have a question on keyboard inputs. Currently I am using this method to read my input, Gdx.input.isKeyPressed(Input.Keys.A), it is working fine. But I do realized at times there are multiple instances ...
0
votes
1answer
65 views

Is it possible to a create an Android game that uses the built in keyboard?

I know the keyboard is probably built into the Android OS and I have a simple game idea, sort of like a word game, but is it possible to create a game that uses this in the game itself?
0
votes
1answer
733 views

What alternatives are there for creating Keyboard/Mouse controls in LWJGL?

So I'm currently working my way through openGL tutorials, using LWJGL to do all my work in. However as I get to the part on how to access Keyboard and Mouse events in this library, I stumble across ...
1
vote
3answers
318 views

Key Handling mechanics

I am new to game development and am working on my first game using OpenGL and C++. I have a game class which handles everything necessary in an update() function. Now i want to handle keyboard inputs. ...
1
vote
1answer
1k views

What does a “video system not initialised” error in pygame mean?

I'm trying to play music when a key is pressed in pygame, then print a message. When I run this script: import pygame import time pressedkeys = pygame.key.get_pressed() pygame.init() ...
1
vote
1answer
77 views

Multiple keypresses causing wierd results in SDL

I have been building a pong clone. I've been using a mixture of peoples different code to understand the way they structure their games as well as reading on game patterns. Currently I've gotten to ...
1
vote
1answer
417 views

TopDown 2d player control

Whats the usual way to control a player in a top down game? We have to look in the direction of the mouse cause the player hold a torch. My first try was: to to make it absolute like W move to ...
1
vote
1answer
290 views

How can I check for key releases between keyReleased callbacks?

Slick2D's Input class has a isKeyPressed() method that returns a boolean value according to whether the specified key has been pressed. I want to check if a key has been released in the same fashion. ...