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

learn more… | top users | synonyms

3
votes
2answers
91 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, ...
2
votes
1answer
63 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 ...
2
votes
4answers
715 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 ...
0
votes
1answer
57 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 ...
0
votes
1answer
37 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 ...
0
votes
1answer
52 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?
1
vote
3answers
91 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
278 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
328 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
1answer
62 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 ...
3
votes
1answer
887 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
1answer
145 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
84 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. ...
0
votes
0answers
70 views

GLFW - getting or setting CapsLock

I'm using GLFW with VC++ 2012, but hoping for any platform-independent method of doing this. For a first-person simulation, I use the typical WASD keys for navigation, and hold down left shift to ...
0
votes
1answer
33 views

Weird case of a key not working [closed]

I finished a game in Java. It works perfectly fine on my computer. Sent it to a friend. On his computer, for some reason, one of the keys that are used to play doesn't work inside the game. (It works ...
1
vote
0answers
86 views

FreeGLUT keyboard IO timing and synchronization

Using FreeGLut's keyboard callbacks, glutKeyboardFunc(); glutKeyboardUpFunc(); glutSpecialFunc(); glutSpecialUpFunc(); When in the glutMainLoop pipeline do these functions get called? In other ...
1
vote
1answer
128 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 ...
0
votes
2answers
288 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 ...
1
vote
2answers
114 views

StringBuffer behavior in LWJGL

Okay, I've been programming in Java for about ten years, but am entirely new to LWJGL. I have a specific problem whilst attempting to create a text console. I have built a class meant to abstract ...
0
votes
1answer
459 views

LWJGL - Continuous key press event without delay

I am checking for key presses and then based on the keys pressed I am moving a square around the screen. I am setting booleans for the keys WASD. But , Whenever I try to keep the key down , it takes a ...
2
votes
3answers
459 views

What are reasons for input polling vs. input events?

I noticed people use both - but is there any empirical evidence when it's better to use one over the other? This is related but not quite a 'why use either' or even 'why use both': Polling vs event ...
0
votes
2answers
2k 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
2answers
1k 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 ...
1
vote
1answer
264 views

LWJGL Wait for key press in a single method

Currently I am implementing the possibility in my game to change the keyboard configuration. Therefor, I have a menu in which is a button for each action the player can do. If the player clicks on one ...
0
votes
1answer
302 views

Design question: How to handle input more efficiently?

I'm designing a system to handle the keyboard input for my game. To get it more simple, I have a class that has two methods, KeyUp and KeyDown which tell me which key has been pressed, this is already ...
1
vote
2answers
228 views

XNA slowly stops sprite movement on key released

I'm making a game where player moves around a spaceship pressing W,S,A,D. What I would like to achieve is that I would like to make the ship stop slightly when a key is released before it went to full ...
2
votes
2answers
1k 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 ...
-3
votes
1answer
78 views

How to Complete a Two Key Animation with One Key [closed]

I have a game where I need to perform an action by pressing U and K at the same time, but I also want it to be accomplished by only using one key, because pressing both at the same time ties up your ...
5
votes
1answer
2k 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
2answers
107 views

Keyboard Enter doing two things at once

In my CheckKeyboard(Keys.Enter) it does both of the things when I only want it to do one and the the other on the next enter click, I can't think of how to fix it. Thanks in Advanced, here is the ...
3
votes
4answers
5k views

Java - Best Implementation KeyListener For Games

I am working on a game using only the swing and awt packages. Note I can only use the default Java libs. Meaning I have to use KeyListener. I have imported KeyListener properly, however, it is still ...
2
votes
2answers
86 views

What is the best way to close dialogs in a platform game controlled by keyboard only

I'm developing a flash puzzle platform game in my free time and I got stuck on deciding how to implement a feature. The game will be controlled by keyboard only, no mouse available. My game will have ...
1
vote
1answer
74 views

Which key bindings to use for switchable primary and secondary attacks?

I am making a game in which the player can have a primary and secondary weapon (like an ability). These are my current planned key bindings: Action | Effect ----------------- Click | Shoot primary ...
2
votes
4answers
2k 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 ...
6
votes
4answers
694 views

How can I handle different keyboard layouts?

Let's say I have a game that uses WASD controls on a QWERTY layout. Trying to use these controls on, say, a Dvorak layout is not ideal (equivalent to <A:H on QWERTY). Obviously, I'd want to use the ...
-1
votes
1answer
164 views

My ClanLib based Keyboard Manager not working [closed]

I created a simple Keyboard manager to detect whether buttons are currently pressed, or if where pressed in that frame. It seems like it should work, yet it seems to not read anything. Here is my ...
2
votes
2answers
1k views

Receiving keyboard events on a canvas in Javascript

I need to receive keyboard events in a canvas element. Click events are received but key presses aren't. Here is my code which doesn't handle key events: var canvasElm = $('canvas'); ...
5
votes
2answers
173 views

Pygame fails on KEYDOWN with Russian keyboard layout

When I press a keyboard button on a keyboard with a Russian layout, my application pygame game crashes with this message: UnicodeEncodeError: 'ascii' codec can't encode character '\u0444' in ...
10
votes
2answers
744 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 ...
1
vote
1answer
2k views

Handling multiple pressed keys with KeyListeners

I'm making a game Applet with Java that uses KeyListeners to control a paddle (for a game like Breakout/Pong). My basic implementation goes like this: public void keyPressed(KeyEvent e) { switch ...
1
vote
1answer
385 views

Keybindings in Unity

I need to know how to bind keys to actions through Javascript within Unity. When I develop web applications, I normally use this: var KeyBind = function() { if (document.addEventListener) { ...
0
votes
4answers
452 views

Twin stick shooting with keyboard

In a top down shooting game, what alternatives are there for input if I want the direction of movement to be independent from the direction I'm shooting at? I'd like to avoid shooting with the mouse ...
1
vote
1answer
149 views

If statement causing xna sprites to draw frame by frame

I’m a bit new to XNA but I wanted to write a simple program that would fire a cannon ball from a cannon at a 45 degree angle. It works fine outside of my keyboard i/o if statement, but when I ...
3
votes
1answer
730 views

Getting the height of Keyboard on Android

Hi I need to know the height of my keyboard so I can move up some textfield I have in my app. I'm using cocos2D-X but the app don't recognize the keyboardWillShow method. Thanks
7
votes
1answer
319 views

Javascript keyDown - no event approach

I'm making game in JavaScript. I have canvas for drawings and game loop. I'd like to make method readKeyboard, in game loop, to check if there is any pressed key. I don't want to attach event to ...
1
vote
3answers
569 views

How can I make smoother upwards/downwards controls in pygame?

This is a loop I use to interpret key events in a python game. # Event Loop for event in pygame.event.get(): if event.type == QUIT: pygame.quit() sys.exit() if event.type == ...
1
vote
4answers
2k views

SDL - Getting a single keypress event instead of a keystate?

Right now I'm working on a simple SDL project, but I've hit an issue when trying to get a single keypress event to skip past a splash screen. Right now, there are 4 start-up splash screens that I ...
0
votes
1answer
321 views

Control convention for circular movement?

I'm currently doing a kind of training project in Unity (still a beginner). It's supposed to be somewhat like Breakout, but instead of just going left and right I want the paddle to circle around the ...
4
votes
3answers
421 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 ...
1
vote
2answers
2k views

Dealing with keyboard input

In game design how should keyboard input be handled and why? Do i A: check the state of keys in the main loop each iteration? B: Read key down and key up events from the event queue. Im using ...