Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
Divide::Input Namespace Reference

Namespaces

namespace  anonymous_namespace{InputHandler.cpp}
 
namespace  Attorney
 

Classes

class  AutoRepeatKey
 
class  Constant
 
class  InputAggregatorInterface
 
struct  InputEvent
 
class  InputHandler
 
struct  JoystickData
 
struct  JoystickElement
 
struct  JoystickEvent
 
struct  KeyEvent
 
struct  KeyMapEntry
 
class  LimitedVariable
 
struct  MouseAxis
 
struct  MouseButtonEvent
 
struct  MouseEvent
 
struct  MouseMoveEvent
 
struct  MouseState
 
struct  TextEvent
 
class  TriangleVariable
 
class  Variable
 
class  VariableEffect
 

Typedefs

using MapVariables = hashMap< U64, Variable * >
 
typedef void(* EffectVariablesApplier) (MapVariables &mapVars, OIS::Effect *pEffect)
 

Enumerations

enum class  Joystick : U8 {
  JOYSTICK_1 = 0 , JOYSTICK_2 = 1 , JOYSTICK_3 = 2 , JOYSTICK_4 = 3 ,
  JOYSTICK_5 = 4 , JOYSTICK_6 = 5 , JOYSTICK_7 = 6 , JOYSTICK_8 = 7 ,
  JOYSTICK_9 = 8 , JOYSTICK_10 = 9 , COUNT
}
 Points to the position of said joystick in the vector. More...
 
enum class  JoystickElementType : U8 {
  POV_MOVE = 0 , AXIS_MOVE , BALL_MOVE , BUTTON_PRESS ,
  JOY_ADD_REMOVE , JOY_REMAP , COUNT
}
 
enum class  JoystickPovDirection : U8 {
  UP = toBit(1) , DOWN = toBit(2) , LEFT = toBit(3) , RIGHT = toBit(4) ,
  CENTERED = toBit(5)
}
 
enum class  MouseButton : U8 {
  MB_Left = 0 , MB_Right , MB_Middle , MB_Button3 ,
  MB_Button4 , MB_Button5 , MB_Button6 , MB_Button7 ,
  COUNT
}
 
enum class  KeyModifier : U16 {
  LSHIFT = toBit(1) , RSHIFT = toBit(2) , LCTRL = toBit(3) , RCTRL = toBit(4) ,
  LALT = toBit(5) , RALT = toBit(6) , LGUI = toBit(7) , RGUI = toBit(8) ,
  NUM = toBit(9) , CAPS = toBit(10) , MODE = toBit(11)
}
 
enum class  KeyCode : U8 {
  KC_UNASSIGNED = 0x00 , KC_ESCAPE = 0x01 , KC_1 = 0x02 , KC_2 = 0x03 ,
  KC_3 = 0x04 , KC_4 = 0x05 , KC_5 = 0x06 , KC_6 = 0x07 ,
  KC_7 = 0x08 , KC_8 = 0x09 , KC_9 = 0x0A , KC_0 = 0x0B ,
  KC_MINUS = 0x0C , KC_EQUALS = 0x0D , KC_BACK = 0x0E , KC_TAB = 0x0F ,
  KC_Q = 0x10 , KC_W = 0x11 , KC_E = 0x12 , KC_R = 0x13 ,
  KC_T = 0x14 , KC_Y = 0x15 , KC_U = 0x16 , KC_I = 0x17 ,
  KC_O = 0x18 , KC_P = 0x19 , KC_LBRACKET = 0x1A , KC_RBRACKET = 0x1B ,
  KC_RETURN = 0x1C , KC_LCONTROL = 0x1D , KC_A = 0x1E , KC_S = 0x1F ,
  KC_D = 0x20 , KC_F = 0x21 , KC_G = 0x22 , KC_H = 0x23 ,
  KC_J = 0x24 , KC_K = 0x25 , KC_L = 0x26 , KC_SEMICOLON = 0x27 ,
  KC_APOSTROPHE = 0x28 , KC_GRAVE = 0x29 , KC_LSHIFT = 0x2A , KC_BACKSLASH = 0x2B ,
  KC_Z = 0x2C , KC_X = 0x2D , KC_C = 0x2E , KC_V = 0x2F ,
  KC_B = 0x30 , KC_N = 0x31 , KC_M = 0x32 , KC_COMMA = 0x33 ,
  KC_PERIOD = 0x34 , KC_SLASH = 0x35 , KC_RSHIFT = 0x36 , KC_MULTIPLY = 0x37 ,
  KC_LMENU = 0x38 , KC_SPACE = 0x39 , KC_CAPITAL = 0x3A , KC_F1 = 0x3B ,
  KC_F2 = 0x3C , KC_F3 = 0x3D , KC_F4 = 0x3E , KC_F5 = 0x3F ,
  KC_F6 = 0x40 , KC_F7 = 0x41 , KC_F8 = 0x42 , KC_F9 = 0x43 ,
  KC_F10 = 0x44 , KC_NUMLOCK = 0x45 , KC_SCROLL = 0x46 , KC_NUMPAD7 = 0x47 ,
  KC_NUMPAD8 = 0x48 , KC_NUMPAD9 = 0x49 , KC_SUBTRACT = 0x4A , KC_NUMPAD4 = 0x4B ,
  KC_NUMPAD5 = 0x4C , KC_NUMPAD6 = 0x4D , KC_ADD = 0x4E , KC_NUMPAD1 = 0x4F ,
  KC_NUMPAD2 = 0x50 , KC_NUMPAD3 = 0x51 , KC_NUMPAD0 = 0x52 , KC_DECIMAL = 0x53 ,
  KC_OEM_102 = 0x56 , KC_F11 = 0x57 , KC_F12 = 0x58 , KC_F13 = 0x64 ,
  KC_F14 = 0x65 , KC_F15 = 0x66 , KC_KANA = 0x70 , KC_ABNT_C1 = 0x73 ,
  KC_CONVERT = 0x79 , KC_NOCONVERT = 0x7B , KC_YEN = 0x7D , KC_ABNT_C2 = 0x7E ,
  KC_NUMPADEQUALS = 0x8D , KC_PREVTRACK = 0x90 , KC_AT = 0x91 , KC_COLON = 0x92 ,
  KC_UNDERLINE = 0x93 , KC_KANJI = 0x94 , KC_STOP = 0x95 , KC_AX = 0x96 ,
  KC_UNLABELED = 0x97 , KC_NEXTTRACK = 0x99 , KC_NUMPADENTER = 0x9C , KC_RCONTROL = 0x9D ,
  KC_MUTE = 0xA0 , KC_CALCULATOR = 0xA1 , KC_PLAYPAUSE = 0xA2 , KC_MEDIASTOP = 0xA4 ,
  KC_TWOSUPERIOR = 0xAA , KC_VOLUMEDOWN = 0xAE , KC_VOLUMEUP = 0xB0 , KC_WEBHOME = 0xB2 ,
  KC_NUMPADCOMMA = 0xB3 , KC_DIVIDE = 0xB5 , KC_SYSRQ = 0xB7 , KC_RMENU = 0xB8 ,
  KC_PAUSE = 0xC5 , KC_HOME = 0xC7 , KC_UP = 0xC8 , KC_PGUP = 0xC9 ,
  KC_LEFT = 0xCB , KC_RIGHT = 0xCD , KC_END = 0xCF , KC_DOWN = 0xD0 ,
  KC_PGDOWN = 0xD1 , KC_INSERT = 0xD2 , KC_DELETE = 0xD3 , KC_LWIN = 0xDB ,
  KC_RWIN = 0xDC , KC_APPS = 0xDD , KC_POWER = 0xDE , KC_SLEEP = 0xDF ,
  KC_WAKE = 0xE3 , KC_WEBSEARCH = 0xE5 , KC_WEBFAVORITES = 0xE6 , KC_WEBREFRESH = 0xE7 ,
  KC_WEBSTOP = 0xE8 , KC_WEBFORWARD = 0xE9 , KC_WEBBACK = 0xEA , KC_MYCOMPUTER = 0xEB ,
  KC_MAIL = 0xEC , KC_MEDIASELECT = 0xED , KC_PRINTSCREEN = 0xEE
}
 
enum class  InputState : U8 { PRESSED = 0 , RELEASED , COUNT }
 

Functions

SDL_Keycode SDLKeyCodeFromKey (KeyCode code) noexcept
 
KeyCode KeyCodeFromSDLKey (SDL_Keycode code) noexcept
 
KeyCode KeyCodeByName (const char *keyName) noexcept
 
MouseButton mouseButtonByName (const string &buttonName)
 
JoystickElement joystickElementByName (const string &elementName)
 
InputState GetKeyState (U8 deviceIndex, KeyCode key) noexcept
 
InputState GetMouseButtonState (U8 deviceIndex, MouseButton button) noexcept
 
InputState GetJoystickElementState (Joystick deviceIndex, JoystickElement element) noexcept
 

Variables

constexpr KeyMapEntry KeyCodeSDLMap []
 

Typedef Documentation

◆ EffectVariablesApplier

typedef void(* Divide::Input::EffectVariablesApplier) (MapVariables &mapVars, OIS::Effect *pEffect)

Definition at line 129 of file InputVariables.h.

◆ MapVariables

Definition at line 128 of file InputVariables.h.

Enumeration Type Documentation

◆ InputState

enum class Divide::Input::InputState : U8
strong
Enumerator
PRESSED 
RELEASED 
COUNT 

Definition at line 278 of file Input.h.

◆ Joystick

enum class Divide::Input::Joystick : U8
strong

Points to the position of said joystick in the vector.

Enumerator
JOYSTICK_1 
JOYSTICK_2 
JOYSTICK_3 
JOYSTICK_4 
JOYSTICK_5 
JOYSTICK_6 
JOYSTICK_7 
JOYSTICK_8 
JOYSTICK_9 
JOYSTICK_10 
COUNT 

Definition at line 39 of file Input.h.

◆ JoystickElementType

Enumerator
POV_MOVE 
AXIS_MOVE 
BALL_MOVE 
BUTTON_PRESS 
JOY_ADD_REMOVE 
JOY_REMAP 
COUNT 

Definition at line 53 of file Input.h.

◆ JoystickPovDirection

Enumerator
UP 
DOWN 
LEFT 
RIGHT 
CENTERED 

Definition at line 63 of file Input.h.

◆ KeyCode

enum class Divide::Input::KeyCode : U8
strong
Enumerator
KC_UNASSIGNED 
KC_ESCAPE 
KC_1 
KC_2 
KC_3 
KC_4 
KC_5 
KC_6 
KC_7 
KC_8 
KC_9 
KC_0 
KC_MINUS 
KC_EQUALS 
KC_BACK 
KC_TAB 
KC_Q 
KC_W 
KC_E 
KC_R 
KC_T 
KC_Y 
KC_U 
KC_I 
KC_O 
KC_P 
KC_LBRACKET 
KC_RBRACKET 
KC_RETURN 
KC_LCONTROL 
KC_A 
KC_S 
KC_D 
KC_F 
KC_G 
KC_H 
KC_J 
KC_K 
KC_L 
KC_SEMICOLON 
KC_APOSTROPHE 
KC_GRAVE 
KC_LSHIFT 
KC_BACKSLASH 
KC_Z 
KC_X 
KC_C 
KC_V 
KC_B 
KC_N 
KC_M 
KC_COMMA 
KC_PERIOD 
KC_SLASH 
KC_RSHIFT 
KC_MULTIPLY 
KC_LMENU 
KC_SPACE 
KC_CAPITAL 
KC_F1 
KC_F2 
KC_F3 
KC_F4 
KC_F5 
KC_F6 
KC_F7 
KC_F8 
KC_F9 
KC_F10 
KC_NUMLOCK 
KC_SCROLL 
KC_NUMPAD7 
KC_NUMPAD8 
KC_NUMPAD9 
KC_SUBTRACT 
KC_NUMPAD4 
KC_NUMPAD5 
KC_NUMPAD6 
KC_ADD 
KC_NUMPAD1 
KC_NUMPAD2 
KC_NUMPAD3 
KC_NUMPAD0 
KC_DECIMAL 
KC_OEM_102 
KC_F11 
KC_F12 
KC_F13 
KC_F14 
KC_F15 
KC_KANA 
KC_ABNT_C1 
KC_CONVERT 
KC_NOCONVERT 
KC_YEN 
KC_ABNT_C2 
KC_NUMPADEQUALS 
KC_PREVTRACK 
KC_AT 
KC_COLON 
KC_UNDERLINE 
KC_KANJI 
KC_STOP 
KC_AX 
KC_UNLABELED 
KC_NEXTTRACK 
KC_NUMPADENTER 
KC_RCONTROL 
KC_MUTE 
KC_CALCULATOR 
KC_PLAYPAUSE 
KC_MEDIASTOP 
KC_TWOSUPERIOR 
KC_VOLUMEDOWN 
KC_VOLUMEUP 
KC_WEBHOME 
KC_NUMPADCOMMA 
KC_DIVIDE 
KC_SYSRQ 
KC_RMENU 
KC_PAUSE 
KC_HOME 
KC_UP 
KC_PGUP 
KC_LEFT 
KC_RIGHT 
KC_END 
KC_DOWN 
KC_PGDOWN 
KC_INSERT 
KC_DELETE 
KC_LWIN 
KC_RWIN 
KC_APPS 
KC_POWER 
KC_SLEEP 
KC_WAKE 
KC_WEBSEARCH 
KC_WEBFAVORITES 
KC_WEBREFRESH 
KC_WEBSTOP 
KC_WEBFORWARD 
KC_WEBBACK 
KC_MYCOMPUTER 
KC_MAIL 
KC_MEDIASELECT 
KC_PRINTSCREEN 

Definition at line 127 of file Input.h.

◆ KeyModifier

enum class Divide::Input::KeyModifier : U16
strong
Enumerator
LSHIFT 
RSHIFT 
LCTRL 
RCTRL 
LALT 
RALT 
LGUI 
RGUI 
NUM 
CAPS 
MODE 

Definition at line 113 of file Input.h.

◆ MouseButton

enum class Divide::Input::MouseButton : U8
strong
Enumerator
MB_Left 
MB_Right 
MB_Middle 
MB_Button3 
MB_Button4 
MB_Button5 
MB_Button6 
MB_Button7 
COUNT 

Definition at line 101 of file Input.h.

Function Documentation

◆ GetJoystickElementState()

InputState Divide::Input::GetJoystickElementState ( Joystick  deviceIndex,
JoystickElement  element 
)
noexcept

Definition at line 188 of file Input.cpp.

◆ GetKeyState()

InputState Divide::Input::GetKeyState ( U8  deviceIndex,
KeyCode  key 
)
noexcept

Definition at line 150 of file Input.cpp.

◆ GetMouseButtonState()

InputState Divide::Input::GetMouseButtonState ( U8  deviceIndex,
MouseButton  button 
)
noexcept

Definition at line 157 of file Input.cpp.

◆ joystickElementByName()

JoystickElement Divide::Input::joystickElementByName ( const string elementName)

Definition at line 30 of file InputAggregatorInterface.cpp.

◆ KeyCodeByName()

KeyCode Divide::Input::KeyCodeByName ( const char *  keyName)
noexcept

Definition at line 146 of file Input.cpp.

◆ KeyCodeFromSDLKey()

KeyCode Divide::Input::KeyCodeFromSDLKey ( SDL_Keycode  code)
noexcept

Definition at line 136 of file Input.cpp.

◆ mouseButtonByName()

MouseButton Divide::Input::mouseButtonByName ( const string buttonName)

Definition at line 10 of file InputAggregatorInterface.cpp.

◆ SDLKeyCodeFromKey()

SDL_Keycode Divide::Input::SDLKeyCodeFromKey ( KeyCode  code)
noexcept

Definition at line 126 of file Input.cpp.

Variable Documentation

◆ KeyCodeSDLMap

constexpr KeyMapEntry Divide::Input::KeyCodeSDLMap[]
constexpr

Definition at line 14 of file Input.cpp.