Hardware‎ > ‎

Input

Insert coin

All the strange ways to interface with a computer. Mostly focused on games. The input design section list the controls that are in use right now.

Digital & Analog
The many forms of input can be split into two categories, digital and analog. Many devices have both types, the xbox 360 controller have 10 digital inputs and 8 analog ones.

Digital
A digital input has a binary state; it can be 'on' or 'off'. One example would be a key on a keyboard. It's pressed down or isn't. When working with digital devices there is often a way to query the state of the device and it returns a array with the bool status of all keys. Each index is connected to a specific key on the device and these index is called keycodes.

This only gives the current status of the keys so the values of the keys from the last frame should also be saved. That makes it possible to compare the old status of a key with the new status. This table show the state of the key depending on the status of the current and last frame. 

 StateOld Key
Key
 Up  False 
 Pressed False True Has key been pressed down this frame.
 Down  True 
 Released True False Has it been let go this frame.

Analog
A analog input device returns a value among a range of values. A joystick can for example return the position of the x-axis of the stick as floating point number between -1 (left) and 1 (right). When reading analog input data one might need to do some filtering to get rid of some spurious data.

Dead Zone
In an ideal world a analog stick should always return zero in the center position of each axis. That is not the case so often one need to put a dead zone in the center where one treat small inputs as zero.

Snap Back
When releasing a analog stick on a gamepad it can snap back past the zero position and give of false input.


Devices
Keyboard

Mouse
A mouse have a X and Y axis for movement and a Z axis that can be used for scroll wheels. Position can be returned relative from the last update or absolute on the screen. The mouse also have a number of buttons and most common is three buttons.

Gamepad

Joystick

Dance pad
A flat mat with bug buttons that one step one. Common size is 3x3 buttons. Used mainly in different types of dance games.

Light Gun
A controller that the player aims and shoots at the screen. Older ones that was aimed at CRT's worked by the game flashing the screen at the target for a short period and the gun detecting the light. Newer ones like the Wii zapper use the wiis infrared camera and led's in the sensor bar to detect where the player is aiming.

Microphone
Used in some games and a peripheral no one asked for.

Motion Sensor
A motion sensor like the Wii Remote detects when the control is moved or turned. How detail the detection is varies with the device.

Motion Tracking

Detect the movement of the user with a camera.

Panels
Really fanatic people build their own custom control panels for games. Common games are flightsims and they are then called simpits.

Pedals
Control pedals used for car and flight simulators.

Steering Wheel
A wheel with a number of buttons and a stick or paddles for the gears as most driving enthusiasts hate automatic gears. Often include pedals also.

Throttle
One or more levers used to simulate throttles on a aircraft.

Touch screen

Yoke
Like a steering wheel but it can also move forward and backward. For flight-simulators.