Input is data provided to a game via player interaction (through the mouse, keyboard, gamepad, et cetera).

learn more… | top users | synonyms

0
votes
0answers
28 views

how do i drop a block into grid?

I am trying to drag a block and place it on a grid in unity5. The grid can be empty or already occupied. How do I handle the dropping of block ? I have a 2D array of blocks type, where: class ...
0
votes
1answer
37 views

SDL Key Input previous and current key states not working as expected, how to fix?

Here is my code that's part of the main game loop: // ResetKeyState stores currentKeyState in previousKeyState // and then clears currentKeyState engine.ResetKeyState(); // Fill ...
0
votes
0answers
30 views

What are the benefits of decoupling the input system from the gameplay system?

I want to decouple as many systems as possible from the main loop. Probably the most beneficial would be to decouple the renderer and the gameplay system. But I am wondering about what I should do ...
0
votes
2answers
27 views

Getting input from just one Axis at a time

I'm trying to make a CharacterController2D Script for a simple 2D TopDown game, but i was wondering, what would be the best way to disable 2-axis movement? just allowing one direction at a time (Maybe ...
1
vote
1answer
35 views

controll mouse cursor movement speed in unity

Im searching for a way to lower my mouse movement cursor speed and not to let the user move it fast but i dont know how. i searched in internet but could not find something Usefull. thank you for ...
0
votes
1answer
37 views

Libgdx unable to enter input in TextFields

Hello I am trying to make login screen for my game, I use TextField's. 1. I am not satisfied with how they look I want it to look like this but simpler - basically to have a white field next to the ...
1
vote
1answer
45 views

AntTweakBar doesn't register SFML mouse events

I'm trying to add GUI for easier level editing in our game engine. We're using SFML for all the basic stuff (window management, input events etc). I've chosen AntTweakBar because it is a well known ...
0
votes
0answers
43 views

Get Mouse Location With Respect to any Camera/Object in Unreal

Am Currently working on a VR Project (First Person Shooter) where the Player can shoot any where on the screen. Am using Scene Capture to Texture method. The VR part is working fine. The Problem am ...
0
votes
3answers
81 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
116 views

How to make inputing large inputs more engaging [closed]

I asked this question on another exchange "Encrypted content in games" and it made me wonder about game design. The basics of that question is that you are using user-input, either directly or ...
1
vote
2answers
80 views

How to know when user has stopped dragging

How can we know when user has stopped dragging fingers over screen if user has not removed finger from screen but stopped dragging ?
1
vote
0answers
31 views

Unity: onEditEnd and onSubmit only firing from Return key

I have an InputField in my UI, but currently I can only submit its contents via the Return key. I tried mapping other buttons to the Submit action (e.g. the tab key on keyboard and the X button on my ...
1
vote
0answers
27 views

Unity keyboard GUI navigation priority

I noticed something strange while playing with my menu on keyboard. I have four items arranged in a square (i.e. the top-left item should be able to navigate to the top-right and the bottom-left). If ...
0
votes
1answer
34 views

How to enforce touching within a ring shape?

I'd like to have the player moving the finger within the shaded ring: The game should be able to detect "out-of-boundary" events once the finger moves outside the ring. How can I accomplish this?
0
votes
1answer
285 views

Handling Back Button in Android without implementing InputProcessor

Please advice/clarifyon below issue in libgdx while handling back button in Screens. I have already gone through these 2 threads, ...
0
votes
0answers
30 views

How to hook up mouse listener in Slick2D

I'm trying to code a "Button"-class in java using the Slick2D-GameEngine. Does anyone who is familiar with this engine know where and how exactly to hook up this class to the GameContainer's ...
1
vote
2answers
86 views

Detecting first or second Mouse Button Release?

I want to know how to detect if the user has released the mouse button the first time, or the times after that: Pseudo-Code: if *first* (Input.GetMouseButtonUp(0)) { do something } ...
3
votes
3answers
83 views

MonoGame - Ordering Movement Key Presses

I'm looking for a way to retrieve the last key pressed even when other keys might be pressed for a top-down four-directional game. For example: W is pressed → Move up D is pressed → Move ...
4
votes
1answer
61 views

What is an OO way for my input layer to act upon objects?

I'm building a top-down RPG specifically to practice Object Oriented thinking and design. I am keeping in mind coupling, single-responsibility, and so forth. One design issue that's been bugging me is ...
0
votes
0answers
70 views

Simulate a touch on a point where ray hits in Unity

I want to simulate a touch input on the position where a ray hits an object, and only if it hits something. I know that it's not common to do it with a raycast, but I need it this way for the HTC ...
1
vote
0answers
23 views

What are some different types of device motion gestures? [closed]

Complex touch events are well-defined and can even be categorised as seen in this Wikipedia article We have great names for various touch gestures like: Double-tap Pinch / Zoom Long Press etc. ...
0
votes
0answers
46 views

How to activate user input modules with platform defines in unity?

I'm having some trouble understanding the activation process with input modules. I'm making a game that can work on mobile or on Desktop in VR. Basically, it works by creating a world-space canvas ...
2
votes
1answer
164 views

Unity Controller navigating UI

I want players to be able to use a controller to navigate our game's menus. We use Unity's new UI, and in the EventSystem have specified a controller axis for our vertical axis. However the selection ...
0
votes
1answer
62 views

Import JXInput by StrikerX3 Into Eclipse

I'll be honest, I'm stumped, I've been trying all night, googling away, made multiple attempts and failed every time. The library in question that I'm trying to add to my project is: ...
0
votes
1answer
35 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 ...
0
votes
1answer
30 views

Setting the cursor's location in JavaFX

Is there a way to set the cursor's location in JavaFX while the window is in focus? I've searched the possibility of the Scene's cursor object, but that leads to a dead end.
3
votes
1answer
97 views

Testing SFML sf::Touch on ordinary PC

So I’ve created a small app that is designed to be used on smartphones and tablets. Accordingly the app makes use of the sf::Touch class which determines the point on the screen of the device that the ...
3
votes
0answers
231 views

Input.GetAxis(“Horizontal”) not updating

I'm having trouble with Unity's basic character controlling. After i implemented the crouching in the code below the Input.GetAxis("Horizontal") does not update (while the left control is pressed ...
1
vote
1answer
34 views

Help with open and close UI Menu on background mouse click

I am trying to make a point and click game in unity 5.2.2. My problem is that I need to have a UI menu to open, when the player clicks with the left mouse button on the background sprite, and it ...
1
vote
1answer
68 views

How to handle complex input

In my Libgdx project i need to handle several types of inputs. In particular these input events are needed in order to interact with the Actors that the user puts in the Stage. The possible ...
1
vote
1answer
66 views

Java game LWJGL input doesnt work properly

Im making a game in LWJGL 2 and Slick2d. Im trying to add an item to my inventory by releasing a key (the inventory system works properly, the part where I have to see if the button was RELEASED is ...
1
vote
1answer
76 views

LibGDX Headless System.in

I started developing a little multiplayer game with LibGDX and Kryonet. I'm also using the headless backend for the server. So far everything went well, but now I'd like to create a command-line ...
1
vote
1answer
96 views

Handling multiple input mapped to single in-game controls

I am trying to map multiple input types to single in-game controls using libGDX's InputProcessor and ControllerListener interfaces. Currently, I have created a single InputType interface which is ...
15
votes
2answers
2k views

How to avoid ghosting when pressing multiple keys?

I am working on a 2d side-scrolling pc game that uses SFML game library. The problem that I am not able to solve is that in many keyboards combination of three or more keys (like w + d + k) is not ...
23
votes
4answers
6k views

Is it normal for a game to use 100% CPU?

I just implemented multi-threaded input handling in my game engine where the code that polls the OS to gather input from it and time stamps them is in a separate thread and each frame in the main ...
6
votes
3answers
957 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 ...
0
votes
0answers
44 views

Input management with context mapping for javascript game (I need a boilerplate code sample)

I have been working on an entity component system latelly and now it is time to add input management into the mix. I have read through a few tutorials about input management and as far as I understand ...
1
vote
2answers
256 views

How to stop movement when an action key is pressed even if movement key is pressed

I'm making a 2d side-scrolling fighting game in game maker:studio and I want to make a code that when the player attacks he stops moving. I've tried some options: keyboard_check(ord("D")); both ...
1
vote
1answer
72 views

Basic game loop, what does Update() and HandleInput() mean to you?

I have been developing a game and until now I have been handling input like so: Player presses a key HandleInput() acknowledges a key is pressed calls a function within the Player class which ...
0
votes
1answer
60 views

How to create axes for a console controller

What should I change in the input manager to enable me to use a joystick? I have a usb cable to connect the joystick to the computer but how do I set up the controls?
1
vote
1answer
43 views

SDL.NET no longer detecting modifier keys

I'm using SDL.NET with C#. Recently, a bug has appeared where the library does not detect if the shift key is held down; although it used to do so. private static void KeyboardEventHandler(object ...
1
vote
2answers
73 views

Handling Input During Frame Drop?

So i was wondering how games handle input so that the input is still handled even in cases of the frame rate being really low. Assuming the input logic is in the same thread as the rendering in the ...
1
vote
4answers
140 views

Moving Object on One Axis

Hi Im trying to move some 3D text on one axis, but for some reason it moves on 2 with this code. Can someone explain why this is/ how to fix it? Maybe this is a simple solution but i cant find it. ...
0
votes
1answer
115 views

Getting mouse movement value with DirectX Tool Kit

today I want to ask a question about how to get mouse movement value with DirectX Tool Kit. While I can certainly use Mouse::SetMode(MODE_RELATIVE), to do this, I want to be able to get the mouse ...
2
votes
1answer
115 views

Using USB sound input for an android game - is it possible?

We are brainstorming ideas for an app, for a major project using Android Studio, and writing in java. My major is game development, so I intend on trying to build a video game based off the use of an ...
1
vote
1answer
46 views

Multiple input not working properly

I have 3 different buttons, one for each action. I want to be able to jump and walk at the same time, but there's a little problem. jumpButton doesn't work while I'm pressing leftButton or rightButton ...
0
votes
0answers
163 views

GLFW - Event Polling System

I need some help on design. I'm making an event polling system, where a window is notified of events as they happen. I handle events at a system level in my GLFW backend, by using callbacks. ...
1
vote
3answers
77 views

How to architect input code to utilise state machine?

I have an InputController which currently handles all user input, so it looks at button states and updates entity intentions according to some simple rules. I'm looking to add a new state to the game ...
1
vote
1answer
41 views

libGDX sprite image not updating Event Handling InputHandler

I created a separate inputHandler class implementing InputProcessor. I'm using Event Handling (libgdx github page: https://github.com/libgdx/libgdx/wiki/Event-handling) public class inputHandler ...
0
votes
2answers
139 views

Getting if a key was released/pressed this frame (C++/SDL2)

Getting if a key is currently down is easy. Just return keys[scancode]: switch (ev.type) { case SDL_KEYDOWN: keys[ev.key.keysym.scancode] = true; break; case SDL_KEYUP: ...