Vegastrike 0.5.1 rc1
1.0
Original sources for Vegastrike Evolved
|
#include <queue>
#include <list>
#include "vegastrike.h"
#include "vs_globals.h"
#include "in_kb.h"
#include "in_handler.h"
#include "gldrv/winsys.h"
#include "in_kb_data.h"
Go to the source code of this file.
Classes | |
struct | HandlerCall |
Functions | |
static void | DefaultKBHandler (const KBData &, KBSTATE newState) |
static void | kbGetInput (int key, int modifiers, bool release, int x, int y) |
static bool | kbHasBinding (int key, int modifiers) |
int | shiftup (int ch) |
int | shiftdown (int ch) |
void | setActiveModifiers (unsigned int mask) |
unsigned int | getActiveModifiers () |
unsigned int | pullActiveModifiers () |
unsigned int | getModifier (const char *mod_name) |
int | getModifier (bool alton, bool cntrlon, bool shifton) |
void | glut_keyboard_cb (unsigned int ch, unsigned int mod, bool release, int x, int y) |
void | RestoreKB () |
void | InitKB () |
void | ProcessKB (unsigned int player) |
void | BindKey (int key, unsigned int mod, unsigned int player, KBHandler handler, const KBData &data) |
void | UnbindKey (int key, unsigned int mod) |
Variables | |
static HandlerCall | keyBindings [LAST_MODIFIER][WSK_LAST] |
static unsigned int | playerBindings [LAST_MODIFIER][WSK_LAST] |
KBSTATE | keyState [LAST_MODIFIER][WSK_LAST] |
static const char | _lomap [] = "0123456789-=\';/.,`\\" |
static const char | _himap [] = ")!@#$%^&*(_+\":?><~|" |
static unsigned int | _activeModifiers = 0 |
void BindKey | ( | int | key, |
unsigned int | mod, | ||
unsigned int | player, | ||
KBHandler | handler, | ||
const KBData & | data | ||
) |
Definition at line 213 of file in_kb.cpp.
References HandlerCall::data, HandlerCall::function, playerBindings, and RESET.
Referenced by createObjects(), and InitializeInput().
Definition at line 31 of file in_kb.cpp.
Referenced by HandlerCall::HandlerCall().
unsigned int getActiveModifiers | ( | ) |
Definition at line 109 of file in_kb.cpp.
References _activeModifiers.
Referenced by pullActiveModifiers().
unsigned int getModifier | ( | const char * | mod_name) |
Definition at line 120 of file in_kb.cpp.
References KB_MOD_ALT, KB_MOD_CTRL, and KB_MOD_SHIFT.
Referenced by glut_keyboard_cb().
Definition at line 137 of file in_kb.cpp.
References DOWN, getModifier(), i, KB_MOD_ALT, KB_MOD_MASK, kbGetInput(), kbHasBinding(), keyState, LAST_MODIFIER, setActiveModifiers(), shiftdown(), shiftup(), WSK_MOD_LALT, WSK_MOD_LCTRL, WSK_MOD_LSHIFT, WSK_MOD_RALT, WSK_MOD_RCTRL, and WSK_MOD_RSHIFT.
Referenced by RestoreKB().
void InitKB | ( | ) |
Definition at line 195 of file in_kb.cpp.
References a, i, KEYMAP_SIZE, keyState, LAST_MODIFIER, RestoreKB(), UnbindKey(), and UP.
Referenced by InitInput().
FIXME If key is out of array index range, do nothing. This is a quick hack, the underlying cause of invalid parameters ever being given should probably be fixed instead
Definition at line 48 of file in_kb.cpp.
References _Universe, Universe::CurrentCockpit(), DOWN, HandlerCall::function, i, keyState, playerBindings, PRESS, RELEASE, RESET, Universe::SetActiveCockpit(), UP, and WSK_LAST.
Referenced by glut_keyboard_cb().
Definition at line 63 of file in_kb.cpp.
References HandlerCall::function.
Referenced by glut_keyboard_cb().
void ProcessKB | ( | unsigned int | player) |
Definition at line 205 of file in_kb.cpp.
References a, HandlerCall::function, KEYMAP_SIZE, keyState, LAST_MODIFIER, and playerBindings.
Referenced by ProcessInput().
unsigned int pullActiveModifiers | ( | ) |
Definition at line 113 of file in_kb.cpp.
References getActiveModifiers().
Referenced by BaseUtil::SetKeyStatusEventData().
void RestoreKB | ( | ) |
Definition at line 184 of file in_kb.cpp.
References a, DOWN, HandlerCall::function, glut_keyboard_cb(), i, KEYMAP_SIZE, keyState, LAST_MODIFIER, RELEASE, UP, and winsys_set_keyboard_func().
Referenced by GameCockpit::Draw(), InitKB(), restore_main_loop(), CockpitKeys::TextMessageCallback(), and NavComputer::toggleVisibility().
void setActiveModifiers | ( | unsigned int | mask) |
Definition at line 96 of file in_kb.cpp.
References _activeModifiers.
Referenced by base_keyboard_cb(), gamemenu_keyboard_handler(), and glut_keyboard_cb().
Definition at line 72 of file in_kb.cpp.
References _himap, _lomap, and c.
Referenced by base_keyboard_cb(), gamemenu_keyboard_handler(), glut_keyboard_cb(), nav_keyboard_cb(), and CockpitKeys::TextMessageCallback().
|
static |
Definition at line 94 of file in_kb.cpp.
Referenced by getActiveModifiers(), and setActiveModifiers().
|
static |
Definition at line 70 of file in_kb.cpp.
Referenced by shiftdown(), and shiftup().
|
static |
Definition at line 69 of file in_kb.cpp.
Referenced by shiftdown(), and shiftup().
|
static |
KBSTATE keyState[LAST_MODIFIER][WSK_LAST] |
Definition at line 46 of file in_kb.cpp.
Referenced by AddListener(), glut_keyboard_cb(), InitKB(), kbGetInput(), CoordinateSelect::MouseMoveHandle(), LocationSelect::MouseMoveHandle(), ProcessKB(), and RestoreKB().
|
static |
Definition at line 45 of file in_kb.cpp.
Referenced by BindKey(), kbGetInput(), and ProcessKB().