#include <input.h>
Enum data | |
enum | eScancode { scancode_bad = -2, scancode_always = -1, scancode_none = 0, scancode_esc = 1 , scancode_end_keyboard = 512 , scancode_mouse_right = 281 , scancode_joy_button_1 = 256 , scancode_joy2_button_1 = 268 } |
Input scancodes (keyboard, mouse, joypad, etc.). More... | |
static eScancode | scancode_for_str (const char *str) |
Get the scancode for the character string input. | |
Public Member Functions | |
Create methods | |
CInputMap () | |
Create with default values. | |
CInputMap (const char *c) | |
Create an input map using the character string. | |
CInputMap (const char *c1, const char *c2) | |
Create an input map using the character strings. | |
CInputMap (eScancode newcode1, eScancode newcode2=scancode_none) | |
Create an input map using scancode values. | |
Info methods | |
bool | is_empty () |
| |
bool | is_down () |
Is a key pressed? | |
unit | get_value () |
Get value/state of input. | |
unit | get_joy_value (unit raw) const |
Convert raw joystick values into a range (-2 to +2). | |
Get/Set methods | |
int | get_cntl1 () const |
| |
int | get_cntl2 () const |
| |
int | get_cntl1_str () const |
Get the string for the controller. | |
int | get_cntl2_str () const |
Get the string for the second part of the controller. | |
void | set (const int newcode1, const int newcode2=0) |
Set to the new scancode. | |
bool | set (const char *strCode1, const char *strCode2=0) |
Set to the new scancode from character strings. | |
void | set_delay (const int tick) |
Set a delay between inputs. | |
void | set_scaler (const unit f) |
(c) 2007-2008 oP group Germany GbR. All rights reserved.
This source code is provided "as is" with no warranty and must not be distributed without written permission.
enum CInputMap::eScancode |
Input scancodes (keyboard, mouse, joypad, etc.).
Create an input map using scancode values.
newcode1 | Scancode of first input. | |
newcode2 | Scancode of second input (none if left blank). |
CInputMap::eScancode CInputMap::scancode_for_str | ( | const char * | str | ) | [static] |
Get the scancode for the character string input.
str | Character string used to lookup scancode. |
< convert to char since key_for_str does not take const char*
bool CInputMap::is_down | ( | ) |
Is a key pressed?
false if neither scancode1 and scancode2 are pressed
unit CInputMap::get_value | ( | ) |
Get value/state of input.
unit CInputMap::get_joy_value | ( | unit | raw | ) | const |
Convert raw joystick values into a range (-2 to +2).
raw | Raw joystick input. |
bool CInputMap::set | ( | const char * | strCode1, | |
const char * | strCode2 = 0 | |||
) |
Set to the new scancode from character strings.
strCode1 | String used for scancode. | |
strCode2 | String used for scancode2 (optional). |
void CInputMap::set_delay | ( | const int | tick | ) | [inline] |
Set a delay between inputs.
tick | Time to delay between reporting inputs (in ticks). |