Antkeeper  0.0.1
Namespaces | Classes | Enumerations
input Namespace Reference

Input devices, events, and mapping. More...

Namespaces

 modifier_key
 Modifier key bit mask flags.
 

Classes

struct  action_activated_event
 Event generated when an action has been activated. More...
 
struct  action_active_event
 Event generated while an action is active. More...
 
struct  action_deactivated_event
 Event generated when an action has been deactivated. More...
 
class  action_map
 Maps input to a set of contextually-related actions. More...
 
class  action
 Evaluates an activation state given input values and publishes events on activation state changes. More...
 
struct  application_quit_event
 Event generated when the application has been requested to quit. More...
 
struct  device_connected_event
 Event generated when an input device has been connected. More...
 
struct  device_disconnected_event
 Event generated when an input device has been disconnected. More...
 
class  device
 Abstract base class for virtual devices that generate input events. More...
 
struct  gamepad_button_pressed_event
 Event generated when a gamepad button has been pressed. More...
 
struct  gamepad_button_released_event
 Event generated when a gamepad button has been released. More...
 
struct  gamepad_axis_moved_event
 Event generated when a gamepad axis has been moved. More...
 
class  gamepad
 A virtual gamepad which generates gamepad-related input events. More...
 
struct  update_event
 Event generated after input events are polled. More...
 
struct  key_pressed_event
 Event generated when a keyboard key has been pressed. More...
 
struct  key_released_event
 Event generated when a keyboard key has been released. More...
 
class  keyboard
 A virtual keyboard which generates keyboard-related input events. More...
 
class  mapper
 Listens for input events and generates corresponding input mappings. More...
 
struct  gamepad_axis_mapped_event
 Event generated when a gamepad axis mapping has been generated. More...
 
struct  gamepad_button_mapped_event
 Event generated when a gamepad button mapping has been generated. More...
 
struct  key_mapped_event
 Event generated when a key mapping has been generated. More...
 
struct  mouse_button_mapped_event
 Event generated when a mouse button mapping has been generated. More...
 
struct  mouse_motion_mapped_event
 Event generated when a mouse motion mapping has been generated. More...
 
struct  mouse_scroll_mapped_event
 Event generated when a mouse scroll mapping has been generated. More...
 
class  mapping
 Abstract base class for input mappings. More...
 
class  gamepad_axis_mapping
 Maps a direction along a gamepad axis to a control input value. More...
 
class  gamepad_button_mapping
 Maps a gamepad button to a control input value. More...
 
class  key_mapping
 Maps a keyboard key to a control input value. More...
 
class  mouse_button_mapping
 Maps a mouse button to a control input value. More...
 
class  mouse_motion_mapping
 Maps a direction along a mouse motion axis to a control input value. More...
 
class  mouse_scroll_mapping
 Maps a direction along a mouse scroll axis to a control input value. More...
 
struct  mouse_moved_event
 Event generated when a mouse has been moved. More...
 
struct  mouse_button_pressed_event
 Event generated when a mouse button has been pressed. More...
 
struct  mouse_button_released_event
 Event generated when a mouse button has been released. More...
 
struct  mouse_scrolled_event
 Event generated when a mouse has been scrolled. More...
 
class  mouse
 A virtual mouse which generates mouse-related input events. More...
 

Enumerations

enum class  device_type : std::uint8_t { gamepad , keyboard , mouse }
 Input device types. More...
 
enum class  gamepad_axis : std::uint8_t {
  left_stick_x , left_stick_y , right_stick_x , right_stick_y ,
  left_trigger , right_trigger
}
 Gamepad axes. More...
 
enum class  gamepad_button : std::uint8_t {
  a , b , x , y ,
  back , guide , start , left_stick ,
  right_stick , left_shoulder , right_shoulder , dpad_up ,
  dpad_down , dpad_left , dpad_right
}
 Gamepad buttons. More...
 
enum class  gamepad_response_curve : std::uint8_t { linear , square , cube }
 Gamepad axis activation response curves. More...
 
enum class  mapping_type : std::uint8_t {
  gamepad_axis , gamepad_button , key , mouse_button ,
  mouse_motion , mouse_scroll
}
 Input mapping types. More...
 
enum class  mouse_button : std::uint8_t { left = 1 , middle = 2 , right = 3 }
 Mouse buttons. More...
 
enum class  mouse_motion_axis : std::uint8_t { x = 0 , y = 1 }
 Mouse motion axes. More...
 
enum class  mouse_scroll_axis : std::uint8_t { x = 0 , y = 1 }
 Mouse scroll axes. More...
 
enum class  scancode : std::uint16_t {
  error_roll_over = 0x01 , post_fail = 0x02 , error_undefined = 0x03 , a = 0x04 ,
  b = 0x05 , c = 0x06 , d = 0x07 , e = 0x08 ,
  f = 0x09 , g = 0x0a , h = 0x0b , i = 0x0c ,
  j = 0x0d , k = 0x0e , l = 0x0f , m = 0x10 ,
  n = 0x11 , o = 0x12 , p = 0x13 , q = 0x14 ,
  r = 0x15 , s = 0x16 , t = 0x17 , u = 0x18 ,
  v = 0x19 , w = 0x1a , x = 0x1b , y = 0x1c ,
  z = 0x1d , digit_1 = 0x1e , digit_2 = 0x1f , digit_3 = 0x20 ,
  digit_4 = 0x21 , digit_5 = 0x22 , digit_6 = 0x23 , digit_7 = 0x24 ,
  digit_8 = 0x25 , digit_9 = 0x26 , digit_0 = 0x27 , enter = 0x28 ,
  escape = 0x29 , backspace = 0x2a , tab = 0x2b , space = 0x2c ,
  minus = 0x2d , equal = 0x2e , left_brace = 0x2f , right_brace = 0x30 ,
  backslash = 0x31 , non_us_hash = 0x32 , semicolon = 0x33 , apostrophe = 0x34 ,
  grave = 0x35 , comma = 0x36 , dot = 0x37 , slash = 0x38 ,
  caps_lock = 0x39 , f1 = 0x3a , f2 = 0x3b , f3 = 0x3c ,
  f4 = 0x3d , f5 = 0x3e , f6 = 0x3f , f7 = 0x40 ,
  f8 = 0x41 , f9 = 0x42 , f10 = 0x43 , f11 = 0x44 ,
  f12 = 0x45 , print_screen = 0x46 , scroll_lock = 0x47 , pause = 0x48 ,
  insert = 0x49 , home = 0x4a , page_up = 0x4b , del = 0x4c ,
  end = 0x4d , page_down = 0x4e , right = 0x4f , left = 0x50 ,
  down = 0x51 , up = 0x52 , num_lock = 0x53 , kp_slash = 0x54 ,
  kp_asterisk = 0x55 , kp_minus = 0x56 , kp_plus = 0x57 , kp_enter = 0x58 ,
  kp_1 = 0x59 , kp_2 = 0x5a , kp_3 = 0x5b , kp_4 = 0x5c ,
  kp_5 = 0x5d , kp_6 = 0x5e , kp_7 = 0x5f , kp_8 = 0x60 ,
  kp_9 = 0x61 , kp_0 = 0x62 , kp_dot = 0x63 , non_us_backslash = 0x64 ,
  application = 0x65 , power = 0x66 , kp_equal = 0x67 , f13 = 0x68 ,
  f14 = 0x69 , f15 = 0x6a , f16 = 0x6b , f17 = 0x6c ,
  f18 = 0x6d , f19 = 0x6e , f20 = 0x6f , f21 = 0x70 ,
  f22 = 0x71 , f23 = 0x72 , f24 = 0x73 , execute = 0x74 ,
  help = 0x75 , menu = 0x76 , select = 0x77 , stop = 0x78 ,
  again = 0x79 , undo = 0x7a , cut = 0x7b , copy = 0x7c ,
  paste = 0x7d , find = 0x7e , mute = 0x7f , volume_up = 0x80 ,
  volume_down = 0x81 , locking_caps_lock = 0x82 , locking_num_lock = 0x83 , locking_scroll_lock = 0x84 ,
  kp_comma = 0x85 , kp_equal_as400 = 0x86 , international_1 = 0x87 , international_2 = 0x88 ,
  international_3 = 0x89 , international_4 = 0x8a , international_5 = 0x8b , international_6 = 0x8c ,
  international_7 = 0x8d , international_8 = 0x8e , international_9 = 0x8f , lang_1 = 0x90 ,
  lang_2 = 0x91 , lang_3 = 0x92 , lang_4 = 0x93 , lang_5 = 0x94 ,
  lang_6 = 0x95 , lang_7 = 0x96 , lang_8 = 0x97 , lang_9 = 0x98 ,
  alt_erase = 0x99 , sys_req = 0x9a , cancel = 0x9b , clear = 0x9c ,
  prior = 0x9d , return_2 = 0x9e , separator = 0x9f , _out = 0xa0 ,
  oper = 0xa1 , clear_again = 0xa2 , cr_sel = 0xa3 , ex_sel = 0xa4 ,
  kp_00 = 0xb0 , kp_000 = 0xb1 , thousands_separator = 0xb2 , decimal_separator = 0xb3 ,
  currency_unit = 0xb4 , currency_sub_unit = 0xb5 , kp_left_paren = 0xb6 , kp_right_paren = 0xb7 ,
  kp_left_brace = 0xb8 , kp_right_brace = 0xb9 , kp_tab = 0xba , kp_backspace = 0xbb ,
  kp_a = 0xbc , kp_b = 0xbd , kp_c = 0xbe , kp_d = 0xbf ,
  kp_e = 0xc0 , kp_f = 0xc1 , kp_xor = 0xc2 , kp_power = 0xc3 ,
  kp_percent = 0xc4 , kp_less = 0xc5 , kp_greater = 0xc6 , kp_ampersand = 0xc7 ,
  kp_double_ampersand = 0xc8 , kp_vertical_bar = 0xc9 , kp_double_vertical_bar = 0xca , kp_colon = 0xcb ,
  kp_hash = 0xcc , kp_space = 0xcd , kp_at = 0xce , kp_exclam = 0xcf ,
  kp_mem_store = 0xd0 , kp_mem_recall = 0xd1 , kp_mem_clear = 0xd2 , kp_mem_add = 0xd3 ,
  kp_mem_subtract = 0xd4 , kp_mem_multiply = 0xd5 , kp_mem_divide = 0xd6 , kp_plus_minus = 0xd7 ,
  kp_clear = 0xd8 , kp_clear_entry = 0xd9 , kp_binary = 0xda , kp_octal = 0xdb ,
  kp_decimal = 0xdc , kp_hexadecimal = 0xdd , left_ctrl = 0xe0 , left_shift = 0xe1 ,
  left_alt = 0xe2 , left_gui = 0xe3 , right_ctrl = 0xe4 , right_shift = 0xe5 ,
  right_alt = 0xe6 , right_gui = 0xe7
}
 Keyboard scancodes. More...
 

Detailed Description

Input devices, events, and mapping.

Enumeration Type Documentation

◆ device_type

enum input::device_type : std::uint8_t
strong

Input device types.

Enumerator
gamepad 

Gamepad input device.

keyboard 

Keyboard input device.

mouse 

Mouse input device.

Definition at line 28 of file device-type.hpp.

◆ gamepad_axis

enum input::gamepad_axis : std::uint8_t
strong

Gamepad axes.

Enumerator
left_stick_x 

Left stick X-axis.

left_stick_y 

Left stick Y-axis.

right_stick_x 

Right stick X-axis.

right_stick_y 

Right stick Y-axis.

left_trigger 

Left trigger.

right_trigger 

Right trigger.

Definition at line 28 of file gamepad-axis.hpp.

◆ gamepad_button

enum input::gamepad_button : std::uint8_t
strong

Gamepad buttons.

Enumerator

A button.

B button.

X button.

Y button.

back 

Back button.

guide 

Guide button.

start 

Start button.

left_stick 

Left stick button.

right_stick 

Right stick button.

left_shoulder 

Left shoulder button.

right_shoulder 

Right shoulder button.

dpad_up 

D-pad up button.

dpad_down 

D-pad down button.

dpad_left 

D-pad left button.

dpad_right 

D-pad right button.

Definition at line 28 of file gamepad-button.hpp.

◆ gamepad_response_curve

enum input::gamepad_response_curve : std::uint8_t
strong

Gamepad axis activation response curves.

Enumerator
linear 

Linear response curve.

square 

Squared response curve.

cube 

Cubed response curve.

Definition at line 33 of file gamepad.hpp.

◆ mapping_type

enum input::mapping_type : std::uint8_t
strong

Input mapping types.

See also
input::mapping
Enumerator
gamepad_axis 

Gamepad axis mapping.

gamepad_button 

Gamepad button mapping.

key 

Key mapping.

mouse_button 

Mouse button mapping.

mouse_motion 

Mouse motion mapping.

mouse_scroll 

Mouse scroll mapping.

Definition at line 32 of file mapping-type.hpp.

◆ mouse_button

enum input::mouse_button : std::uint8_t
strong

Mouse buttons.

Enumerator
left 

Left mouse button.

middle 

Middle mouse button.

right 

Right mouse button.

Definition at line 28 of file mouse-button.hpp.

◆ mouse_motion_axis

enum input::mouse_motion_axis : std::uint8_t
strong

Mouse motion axes.

Enumerator

X-axis.

Y-axis.

Definition at line 28 of file mouse-motion-axis.hpp.

◆ mouse_scroll_axis

enum input::mouse_scroll_axis : std::uint8_t
strong

Mouse scroll axes.

Enumerator

X-axis.

Y-axis.

Definition at line 28 of file mouse-scroll-axis.hpp.

◆ scancode

enum input::scancode : std::uint16_t
strong

Keyboard scancodes.

See also
HID Usage Tables for Universal Serial Bus (USB) version 1.3, 2022, https://usb.org/sites/default/files/hut1_3_0.pdf.
Enumerator
error_roll_over 
post_fail 
error_undefined 
digit_1 
digit_2 
digit_3 
digit_4 
digit_5 
digit_6 
digit_7 
digit_8 
digit_9 
digit_0 
enter 
escape 
backspace 
tab 
space 
minus 
equal 
left_brace 
right_brace 
backslash 
non_us_hash 
semicolon 
apostrophe 
grave 
comma 
dot 
slash 
caps_lock 
f1 
f2 
f3 
f4 
f5 
f6 
f7 
f8 
f9 
f10 
f11 
f12 
print_screen 
scroll_lock 
pause 
insert 
home 
page_up 
del 
end 
page_down 
right 
left 
down 
up 
num_lock 
kp_slash 
kp_asterisk 
kp_minus 
kp_plus 
kp_enter 
kp_1 
kp_2 
kp_3 
kp_4 
kp_5 
kp_6 
kp_7 
kp_8 
kp_9 
kp_0 
kp_dot 
non_us_backslash 
application 
power 
kp_equal 
f13 
f14 
f15 
f16 
f17 
f18 
f19 
f20 
f21 
f22 
f23 
f24 
execute 
help 
menu 
select 
stop 
again 
undo 
cut 
copy 
paste 
find 
mute 
volume_up 
volume_down 
locking_caps_lock 
locking_num_lock 
locking_scroll_lock 
kp_comma 
kp_equal_as400 
international_1 
international_2 
international_3 
international_4 
international_5 
international_6 
international_7 
international_8 
international_9 
lang_1 
lang_2 
lang_3 
lang_4 
lang_5 
lang_6 
lang_7 
lang_8 
lang_9 
alt_erase 
sys_req 
cancel 
clear 
prior 
return_2 
separator 
_out 
oper 
clear_again 
cr_sel 
ex_sel 
kp_00 
kp_000 
thousands_separator 
decimal_separator 
currency_unit 
currency_sub_unit 
kp_left_paren 
kp_right_paren 
kp_left_brace 
kp_right_brace 
kp_tab 
kp_backspace 
kp_a 
kp_b 
kp_c 
kp_d 
kp_e 
kp_f 
kp_xor 
kp_power 
kp_percent 
kp_less 
kp_greater 
kp_ampersand 
kp_double_ampersand 
kp_vertical_bar 
kp_double_vertical_bar 
kp_colon 
kp_hash 
kp_space 
kp_at 
kp_exclam 
kp_mem_store 
kp_mem_recall 
kp_mem_clear 
kp_mem_add 
kp_mem_subtract 
kp_mem_multiply 
kp_mem_divide 
kp_plus_minus 
kp_clear 
kp_clear_entry 
kp_binary 
kp_octal 
kp_decimal 
kp_hexadecimal 
left_ctrl 
left_shift 
left_alt 
left_gui 
right_ctrl 
right_shift 
right_alt 
right_gui 

Definition at line 32 of file scancode.hpp.