utility 2026.1.9
A comprehensive C++ utilities library tailored for the development of modern desktop and extended reality (XR) applications.
Loading...
Searching...
No Matches
utility::event::KeyboardEvent Class Reference

Keyboard event representation. More...

#include <headers/utility/event/keyboard_event.hpp>

Inheritance diagram for utility::event::KeyboardEvent:
Collaboration diagram for utility::event::KeyboardEvent:

Classes

class  Factory
 Factory for creating KeyboardEvent instances. More...
 

Public Types

enum class  ScanCode : std::uint16_t {
  Unknown = 0 , A = 4 , B = 5 , C = 6 ,
  D = 7 , E = 8 , F = 9 , G = 10 ,
  H = 11 , I = 12 , J = 13 , K = 14 ,
  L = 15 , M = 16 , N = 17 , O = 18 ,
  P = 19 , Q = 20 , R = 21 , S = 22 ,
  T = 23 , U = 24 , V = 25 , W = 26 ,
  X = 27 , Y = 28 , Z = 29 , Num1 = 30 ,
  Num2 = 31 , Num3 = 32 , Num4 = 33 , Num5 = 34 ,
  Num6 = 35 , Num7 = 36 , Num8 = 37 , Num9 = 38 ,
  Num0 = 39 , Return = 40 , Escape = 41 , Backspace = 42 ,
  Tab = 43 , Space = 44 , Minus = 45 , Equals = 46 ,
  LeftBracket = 47 , RightBracket = 48 , Backslash , NonUsHash = 50 ,
  Semicolon = 51 , Apostrophe = 52 , Grave = 53 , Comma = 54 ,
  Period = 55 , Slash = 56 , CapsLock = 57 , F1 = 58 ,
  F2 = 59 , F3 = 60 , F4 = 61 , F5 = 62 ,
  F6 = 63 , F7 = 64 , F8 = 65 , F9 = 66 ,
  F10 = 67 , F11 = 68 , F12 = 69 , PrintScreen = 70 ,
  ScrollLock = 71 , Pause = 72 , Insert = 73 , Home = 74 ,
  PageUp = 75 , Delete = 76 , End = 77 , PageDown = 78 ,
  Right = 79 , Left = 80 , Down = 81 , Up = 82 ,
  NumLockClear = 83 , KeyPadDivide = 84 , KeyPadMultiply = 85 , KeyPadMinus = 86 ,
  KeyPadPlus = 87 , KeyPadEnter = 88 , KeyPad1 = 89 , KeyPad2 = 90 ,
  KeyPad3 = 91 , KeyPad4 = 92 , KeyPad5 = 93 , KeyPad6 = 94 ,
  KeyPad7 = 95 , KeyPad8 = 96 , KeyPad9 = 97 , KeyPad0 = 98 ,
  KeyPadPeriod = 99 , NonUsBackslash , Application = 101 , Power = 102 ,
  KeyPadEquals = 103 , F13 = 104 , F14 = 105 , F15 = 106 ,
  F16 = 107 , F17 = 108 , F18 = 109 , F19 = 110 ,
  F20 = 111 , F21 = 112 , F22 = 113 , F23 = 114 ,
  F24 = 115 , Execute = 116 , Help = 117 , Menu = 118 ,
  Select = 119 , Stop = 120 , Again = 121 , Undo = 122 ,
  Cut = 123 , Copy = 124 , Paste = 125 , Find = 126 ,
  Mute = 127 , VolumeUp = 128 , VolumeDown = 129 , KeyPadComma = 133 ,
  KeyPadEqualsAs400 = 134 , International1 = 135 , International2 = 136 , International3 = 137 ,
  International4 = 138 , International5 = 139 , International6 = 140 , International7 = 141 ,
  International8 = 142 , International9 = 143 , Lang1 = 144 , Lang2 = 145 ,
  Lang3 = 146 , Lang4 = 147 , Lang5 = 148 , Lang6 = 149 ,
  Lang7 = 150 , Lang8 = 151 , Lang9 = 152 , Alterase = 153 ,
  Sysreq = 154 , Cancel = 155 , Clear = 156 , Prior = 157 ,
  Return2 = 158 , Separator = 159 , Out = 160 , Oper = 161 ,
  ClearAgain = 162 , Crsel = 163 , Exsel = 164 , KeyPad00 = 176 ,
  KeyPad000 = 177 , ThousandsSeparator = 178 , DecimalSeparator = 179 , CurrencyUnit = 180 ,
  CurrencySubunit = 181 , KeyPadLeftParen = 182 , KeyPadRightParen = 183 , KeyPadLeftBrace = 184 ,
  KeyPadRightBrace = 185 , KeyPadTab = 186 , KeyPadBackspace = 187 , KeyPadA = 188 ,
  KeyPadB = 189 , KeyPadC = 190 , KeyPadD = 191 , KeyPadE = 192 ,
  KeyPadF = 193 , KeyPadXor = 194 , KeyPadPower = 195 , KeyPadPercent = 196 ,
  KeyPadLess = 197 , KeyPadGreater = 198 , KeyPadAmpersand = 199 , KeyPadDoubleAmpersand = 200 ,
  KeyPadVerticalbar = 201 , KeyPadDoubleVerticalBar , KeyPadColon = 203 , KeyPadHash = 204 ,
  KeyPadSpace = 205 , KeyPadAt = 206 , KeyPadExclam = 207 , KeyPadMemoryStore = 208 ,
  KeyPadMemoryRecall = 209 , KeyPadMemoryClear = 210 , KeyPadMemoryAdd = 211 , KeyPadMemorySubtract = 212 ,
  KeyPadMemoryMultiply = 213 , KeyPadMemoryDivide = 214 , KeyPadPlusMinus = 215 , KeyPadClear = 216 ,
  KeyPadClearEntry = 217 , KeyPadBinary = 218 , KeyPadOctal = 219 , KeyPadDecimal = 220 ,
  KeyPadHexadecimal = 221 , LeftControl = 224 , LeftShift = 225 , LeftAlt = 226 ,
  LeftGui = 227 , RightControl = 228 , RightShift = 229 , RightAlt = 230 ,
  RightGui = 231 , Mode = 257 , Sleep = 258 , Wake = 259 ,
  ChannelIncrement = 260 , ChannelDecrement = 261 , MediaPlay = 262 , MediaPause = 263 ,
  MediaRecord = 264 , MediaFastForward = 265 , MediaRewind = 266 , MediaNextTrack = 267 ,
  MediaPreviousTrack = 268 , MediaStop = 269 , MediaEject = 270 , MediaPlayPause = 271 ,
  MediaSelect = 272 , AcNew = 273 , AcOpen = 274 , AcClose = 275 ,
  AcExit = 276 , AcSave = 277 , AcPrint = 278 , AcProperties = 279 ,
  AcSearch = 280 , AcHome = 281 , AcBack = 282 , AcForward = 283 ,
  AcStop = 284 , AcRefresh = 285 , AcBookmarks = 286 , SoftLeft = 287 ,
  SoftRight = 288 , Call = 289 , EndCall = 290 , Reserved = 400 ,
  Count = 512
}
 Key scan codes. More...
 
enum class  KeyCode : std::int32_t {
  Unknown = -0x00000001 , Space = 0x00000020u , Apostrophe = 0x00000027u , Comma = 0x0000002Cu ,
  Minus = 0x0000002Du , Period = 0x0000002Eu , Slash = 0x0000002Fu , Num0 = 0x00000030u ,
  Num1 = 0x00000031u , Num2 = 0x00000032u , Num3 = 0x00000033u , Num4 = 0x00000034u ,
  Num5 = 0x00000035u , Num6 = 0x00000036u , Num7 = 0x00000037u , Num8 = 0x00000038u ,
  Num9 = 0x00000039u , Semicolon = 0x0000003Bu , Equals = 0x0000003Du , A = 0x00000041u ,
  B = 0x00000042u , C = 0x00000043u , D = 0x00000044u , E = 0x00000045u ,
  F = 0x00000046u , G = 0x00000047u , H = 0x00000048u , I = 0x00000049u ,
  J = 0x0000004Au , K = 0x0000004Bu , L = 0x0000004Cu , M = 0x0000004Du ,
  N = 0x0000004Eu , O = 0x0000004Fu , P = 0x00000050u , Q = 0x00000051u ,
  R = 0x00000052u , S = 0x00000053u , T = 0x00000054u , U = 0x00000055u ,
  V = 0x00000056u , W = 0x00000057u , X = 0x00000058u , Y = 0x00000059u ,
  Z = 0x0000005Au , LeftBracket = 0x0000005Bu , Backslash = 0x0000005Cu , RightBracket = 0x0000005Du ,
  Grave = 0x00000060u , Escape = 0x00000100u , Enter = 0x00000101u , Tab = 0x00000102u ,
  Backspace = 0x00000103u , Insert = 0x00000104u , Delete = 0x00000105u , Right = 0x00000106u ,
  Left = 0x00000107u , Down = 0x00000108u , Up = 0x00000109u , PageUp = 0x0000010Au ,
  PageDown = 0x0000010Bu , Home = 0x0000010Cu , End = 0x0000010Du , CapsLock = 0x00000118u ,
  ScrollLock = 0x00000119u , NumLockClear = 0x0000011Au , PrintScreen = 0x0000011Bu , Pause = 0x0000011Cu ,
  F1 = 0x00000122u , F2 = 0x00000123u , F3 = 0x00000124u , F4 = 0x00000125u ,
  F5 = 0x00000126u , F6 = 0x00000127u , F7 = 0x00000128u , F8 = 0x00000129u ,
  F9 = 0x0000012Au , F10 = 0x0000012Bu , F11 = 0x0000012Cu , F12 = 0x0000012Du ,
  F13 = 0x0000012Eu , F14 = 0x0000012Fu , F15 = 0x00000130u , F16 = 0x00000131u ,
  F17 = 0x00000132u , F18 = 0x00000133u , F19 = 0x00000134u , F20 = 0x00000135u ,
  F21 = 0x00000136u , F22 = 0x00000137u , F23 = 0x00000138u , F24 = 0x00000139u ,
  KeyPad0 = 0x00000140u , KeyPad1 = 0x00000141u , KeyPad2 = 0x00000142u , KeyPad3 = 0x00000143u ,
  KeyPad4 = 0x00000144u , KeyPad5 = 0x00000145u , KeyPad6 = 0x00000146u , KeyPad7 = 0x00000147u ,
  KeyPad8 = 0x00000148u , KeyPad9 = 0x00000149u , KeyPadPeriod = 0x0000014Au , KeyPadDivide = 0x0000014Bu ,
  KeyPadMultiply = 0x0000014Cu , KeyPadMinus = 0x0000014Du , KeyPadPlus = 0x0000014Eu , KeyPadEnter = 0x0000014Fu ,
  KeyPadEquals = 0x00000150u , LeftShift = 0x00000154u , LeftControl = 0x00000155u , LeftAlt = 0x00000156u ,
  LeftGui = 0x00000157u , RightShift = 0x00000158u , RightControl = 0x00000159u , RightAlt = 0x0000015Au ,
  RightGui = 0x0000015Bu
}
 Virtual key codes derived from keyboard scancodes. More...
 
enum class  KeyModifiers : std::uint16_t {
  Unknown = 0x0000u , LeftShift = 0x0001u , RightShift = 0x0002u , Level5Shift = 0x0004u ,
  LeftCtrl = 0x0040u , RightCtrl = 0x0080u , LeftAlt = 0x0100u , RightAlt = 0x0200u ,
  LeftGUI = 0x0400u , RightGUI = 0x0800u , NumLock = 0x1000u , CapsLock = 0x2000u ,
  AltGr = 0x4000u , ScrollLock = 0x8000u , Ctrl = LeftCtrl | RightCtrl , Shift = LeftShift | RightShift ,
  Alt = LeftAlt | RightAlt , Gui = LeftGUI | RightGUI
}
 Key modifier flags. More...
 

Public Member Functions

 KeyboardEvent (void)
 Default constructor.
 
 ~KeyboardEvent (void) override
 Default destructor.
 
ScanCode getScancode (void) const noexcept
 Get the keyboard scancode.
 
KeyboardEventsetScancode (const ScanCode scancode) noexcept
 Set the keyboard scancode.
 
KeyboardEventsetKeycode (const KeyCode keycode) noexcept
 Set the virtual key code.
 
KeyCode getKeycode (void) const noexcept
 Get the virtual key code.
 
KeyboardEventsetModifiers (const KeyModifiers modifiers) noexcept
 Set the key modifiers.
 
bool isModifierSet (const KeyModifiers modifier) const noexcept
 Check if a specific key modifier is set.
 
KeyboardEventsetIsDownEvent (const bool isDown) noexcept
 Set whether the event is a key down event.
 
bool getIsDownEvent (void) const noexcept
 Check if the event is a key down event.
 
KeyboardEventsetIsRepeatEvent (const bool isRepeat) noexcept
 Set whether the event is a key repeat event.
 
bool getIsRepeatEvent (void) const noexcept
 Check if the event is a key repeat event.
 
- Public Member Functions inherited from utility::event::Event
 Event (void)=default
 Default constructor.
 
virtual ~Event (void)=default
 Virtual destructor.
 

Detailed Description

Keyboard event representation.

Represents keyboard events, including key codes and modifier states.

Definition at line 39 of file keyboard_event.hpp.

Member Enumeration Documentation

◆ KeyCode

enum class utility::event::KeyboardEvent::KeyCode : std::int32_t
strong

Virtual key codes derived from keyboard scancodes.

Virtual key codes represent actual keys pressed on the keyboard, including printable characters and special function keys.

Enumerator
Unknown 

Unknown key

Space 

Space key (' ')

Apostrophe 

Apostrophe key (apostrophe)

Comma 

Comma key (',')

Minus 

Minus key ('-')

Period 

Period key ('.')

Slash 

Slash key ('/')

Num0 

0 key ('0')

Num1 

1 key ('1')

Num2 

2 key ('2')

Num3 

3 key ('3')

Num4 

4 key ('4')

Num5 

5 key ('5')

Num6 

6 key ('6')

Num7 

7 key ('7')

Num8 

8 key ('8')

Num9 

9 key ('9')

Semicolon 

Semicolon key (';')

Equals 

Equals key ('=')

A key ('a')

B key ('b')

C key ('c')

D key ('d')

E key ('e')

F key ('f')

G key ('g')

H key ('h')

I key ('i')

J key ('j')

K key ('k')

L key ('l')

M key ('m')

N key ('n')

O key ('o')

P key ('p')

Q key ('q')

R key ('r')

S key ('s')

T key ('t')

U key ('u')

V key ('v')

W key ('w')

X key ('x')

Y key ('y')

Z key ('z')

LeftBracket 

Left bracket key ('[')

Backslash 

Backslash key (backslash)

RightBracket 

Right bracket key (']')

Grave 

Grave key (grave accent)

Escape 

Escape key (0x1B)

Enter 

Return key (CR, 0x0D)

Tab 

Tab key (TAB, 0x09)

Backspace 

Backspace key (BS, 0x08)

Insert 

Insert key

Delete 

Delete key (0x7F)

Right 

Right arrow key

Left 

Left arrow key

Down 

Down arrow key

Up 

Up arrow key

PageUp 

Page Up key

PageDown 

Page Down key

Home 

Home key

End 

End key

CapsLock 

Caps Lock key

ScrollLock 

Scroll Lock key

NumLockClear 

Num Lock key

PrintScreen 

Print Screen key

Pause 

Pause key

F1 

F1 key

F2 

F2 key

F3 

F3 key

F4 

F4 key

F5 

F5 key

F6 

F6 key

F7 

F7 key

F8 

F8 key

F9 

F9 key

F10 

F10 key

F11 

F11 key

F12 

F12 key

F13 

F13 key

F14 

F14 key

F15 

F15 key

F16 

F16 key

F17 

F17 key

F18 

F18 key

F19 

F19 key

F20 

F20 key

F21 

F21 key

F22 

F22 key

F23 

F23 key

F24 

F24 key

KeyPad0 

Keypad 0 key

KeyPad1 

Keypad 1 key

KeyPad2 

Keypad 2 key

KeyPad3 

Keypad 3 key

KeyPad4 

Keypad 4 key

KeyPad5 

Keypad 5 key

KeyPad6 

Keypad 6 key

KeyPad7 

Keypad 7 key

KeyPad8 

Keypad 8 key

KeyPad9 

Keypad 9 key

KeyPadPeriod 

Keypad period key

KeyPadDivide 

Keypad divide key

KeyPadMultiply 

Keypad multiply key

KeyPadMinus 

Keypad minus key

KeyPadPlus 

Keypad plus key

KeyPadEnter 

Keypad enter key

KeyPadEquals 

Keypad equals key

LeftShift 

Left shift key

LeftControl 

Left control key

LeftAlt 

Left alt key

LeftGui 

Left GUI key

RightShift 

Right shift key

RightControl 

Right control key

RightAlt 

Right alt key

RightGui 

Right GUI key

Definition at line 367 of file keyboard_event.hpp.

◆ KeyModifiers

enum class utility::event::KeyboardEvent::KeyModifiers : std::uint16_t
strong

Key modifier flags.

Key modifiers represent the state of modifier keys (like Shift, Ctrl, Alt) during keyboard events.

Enumerator
Unknown 

Unknown modifier state.

LeftShift 

The left Shift key is down.

RightShift 

The right Shift key is down.

Level5Shift 

The Level 5 Shift key is down.

LeftCtrl 

The left Ctrl (Control) key is down.

RightCtrl 

The right Ctrl (Control) key is down.

LeftAlt 

The left Alt key is down.

RightAlt 

The right Alt key is down.

LeftGUI 

The left GUI key (often the Windows key) is down.

RightGUI 

The right GUI key (often the Windows key) is down.

NumLock 

The Num Lock key (may be located on an extended keypad) is down.

CapsLock 

The Caps Lock key is down.

AltGr 

The AltGr key is down.

ScrollLock 

The Scroll Lock key is down.

Ctrl 

Any Ctrl key is down.

Shift 

Any Shift key is down.

Alt 

Any Alt key is down.

Gui 

Any GUI key is down.

Definition at line 493 of file keyboard_event.hpp.

◆ ScanCode

enum class utility::event::KeyboardEvent::ScanCode : std::uint16_t
strong

Key scan codes.

Enumerator
Unknown 

Unknown scan code

A key

B key

C key

D key

E key

F key

G key

H key

I key

J key

K key

L key

M key

N key

O key

P key

Q key

R key

S key

T key

U key

V key

W key

X key

Y key

Z key

Num1 

1 key

Num2 

2 key

Num3 

3 key

Num4 

4 key

Num5 

5 key

Num6 

6 key

Num7 

7 key

Num8 

8 key

Num9 

9 key

Num0 

0 key

Return 

Return key

Escape 

Escape key

Backspace 

Backspace key

Tab 

Tab key

Space 

Space key

Minus 

Minus key

Equals 

Equals key

LeftBracket 

Left bracket key

RightBracket 

Right bracket key

Backslash 

Backslash key. Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout.

NonUsHash 

ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically.

Semicolon 

Semicolon key

Apostrophe 

Apostrophe key

Grave 

Grave key (grave accent). Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards.

Comma 

Comma key

Period 

Period key

Slash 

Slash key

CapsLock 

Caps Lock key

F1 

F1 key

F2 

F2 key

F3 

F3 key

F4 

F4 key

F5 

F5 key

F6 

F6 key

F7 

F7 key

F8 

F8 key

F9 

F9 key

F10 

F10 key

F11 

F11 key

F12 

F12 key

PrintScreen 

Print Screen key

ScrollLock 

Scroll Lock key

Pause 

Pause key

Insert 

Insert key (help on some Mac keyboards)

Home 

Home key

PageUp 

Page Up key

Delete 

Delete key

End 

End key

PageDown 

Page Down key

Right 

Right arrow key

Left 

Left arrow key

Down 

Down arrow key

Up 

Up arrow key

NumLockClear 

Num Lock key (clear on Mac keyboards)

KeyPadDivide 

Keypad divide key

KeyPadMultiply 

Keypad multiply key

KeyPadMinus 

Keypad minus key

KeyPadPlus 

Keypad plus key

KeyPadEnter 

Keypad enter key

KeyPad1 

Keypad 1 key

KeyPad2 

Keypad 2 key

KeyPad3 

Keypad 3 key

KeyPad4 

Keypad 4 key

KeyPad5 

Keypad 5 key

KeyPad6 

Keypad 6 key

KeyPad7 

Keypad 7 key

KeyPad8 

Keypad 8 key

KeyPad9 

Keypad 9 key

KeyPad0 

Keypad 0 key

KeyPadPeriod 

Keypad period key

NonUsBackslash 

This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout.

Application 

Windows contextual menu, compose

Power 

Power key

KeyPadEquals 

Keypad equals key

F13 

F13 key

F14 

F14 key

F15 

F15 key

F16 

F16 key

F17 

F17 key

F18 

F18 key

F19 

F19 key

F20 

F20 key

F21 

F21 key

F22 

F22 key

F23 

F23 key

F24 

F24 key

Execute 

Execute key

Help 

Help key (AL Integrated Help Center)

Menu 

Menu key

Select 

Select key

Stop 

Stop key (AC Stop)

Again 

Again key (AC Redo/Repeat)

Undo 

Undo key (AC Undo)

Cut 

Cut key (AC Cut)

Copy 

Copy key (AC Copy)

Paste 

Paste key (AC Paste)

Find 

Find key (AC Find)

Mute 

Mute key

VolumeUp 

Volume up key

VolumeDown 

Volume down key

KeyPadComma 

Keypad comma key

KeyPadEqualsAs400 

Keypad equals (AS400) key

International1 

Used on Asian keyboards

International2 

Used on Asian keyboards

International3 

Yen key

International4 

Used on Asian keyboards

International5 

Used on Asian keyboards

International6 

Used on Asian keyboards

International7 

Used on Asian keyboards

International8 

Used on Asian keyboards

International9 

Used on Asian keyboards

Lang1 

Hangul/English toggle

Lang2 

Hanja conversion

Lang3 

Katakana

Lang4 

Hiragana

Lang5 

Zenkaku/Hankaku

Lang6 

Reserved

Lang7 

Reserved

Lang8 

Reserved

Lang9 

Reserved

Alterase 

Erase-Eaze

Sysreq 

Sysreq key

Cancel 

Cancel key (AC Cancel)

Clear 

Clear key

Prior 

Prior key

Return2 

Return2 key

Separator 

Separator key

Out 

Out key

Oper 

Oper key

ClearAgain 

Clear again key

Crsel 

Crsel key

Exsel 

Exsel key

KeyPad00 

Keypad 00 key

KeyPad000 

Keypad 000 key

ThousandsSeparator 

Thousands separator key

DecimalSeparator 

Decimal separator key

CurrencyUnit 

Currency unit key

CurrencySubunit 

Currency subunit key

KeyPadLeftParen 

Keypad left parenthesis key

KeyPadRightParen 

Keypad right parenthesis key

KeyPadLeftBrace 

Keypad left brace key

KeyPadRightBrace 

Keypad right brace key

KeyPadTab 

Keypad tab key

KeyPadBackspace 

Keypad backspace key

KeyPadA 

Keypad A key

KeyPadB 

Keypad B key

KeyPadC 

Keypad C key

KeyPadD 

Keypad D key

KeyPadE 

Keypad E key

KeyPadF 

Keypad F key

KeyPadXor 

Keypad XOR key

KeyPadPower 

Keypad power key

KeyPadPercent 

Keypad percent key

KeyPadLess 

Keypad less than key

KeyPadGreater 

Keypad greater than key

KeyPadAmpersand 

Keypad ampersand key

KeyPadDoubleAmpersand 

Keypad double ampersand key

KeyPadVerticalbar 

Keypad vertical bar key

KeyPadDoubleVerticalBar 

Keypad double vertical bar key

KeyPadColon 

Keypad colon key

KeyPadHash 

Keypad hash key

KeyPadSpace 

Keypad space key

KeyPadAt 

Keypad at key

KeyPadExclam 

Keypad exclamation mark key

KeyPadMemoryStore 

Keypad memory store key

KeyPadMemoryRecall 

Keypad memory recall key

KeyPadMemoryClear 

Keypad memory clear key

KeyPadMemoryAdd 

Keypad memory add key

KeyPadMemorySubtract 

Keypad memory subtract key

KeyPadMemoryMultiply 

Keypad memory multiply key

KeyPadMemoryDivide 

Keypad memory divide key

KeyPadPlusMinus 

Keypad plus/minus key

KeyPadClear 

Keypad clear key

KeyPadClearEntry 

Keypad clear entry key

KeyPadBinary 

Keypad binary key

KeyPadOctal 

Keypad octal key

KeyPadDecimal 

Keypad decimal key

KeyPadHexadecimal 

Keypad hexadecimal key

LeftControl 

Left control key

LeftShift 

Left shift key

LeftAlt 

Left alt key (option)

LeftGui 

Left GUI key (windows, command, meta)

RightControl 

Right control key

RightShift 

Right shift key

RightAlt 

Right alt key (alt gr, option)

RightGui 

Right GUI key (windows, command, meta)

Mode 

Mode key

Sleep 

Sleep key

Wake 

Wake key

ChannelIncrement 

Channel increment key

ChannelDecrement 

Channel decrement key

MediaPlay 

Media play key

MediaPause 

Media pause key

MediaRecord 

Media record key

MediaFastForward 

Media fast forward key

MediaRewind 

Media rewind key

MediaNextTrack 

Media next track key

MediaPreviousTrack 

Media previous track key

MediaStop 

Media stop key

MediaEject 

Media eject key

MediaPlayPause 

Media play/pause key

MediaSelect 

Media select key

AcNew 

AC new key

AcOpen 

AC open key

AcClose 

AC close key

AcExit 

AC exit key

AcSave 

AC save key

AcPrint 

AC print key

AcProperties 

AC properties key

AcSearch 

AC search key

AcHome 

AC home key

AcBack 

AC back key

AcForward 

AC forward key

AcStop 

AC stop key

AcRefresh 

AC refresh key

AcBookmarks 

AC bookmarks key

SoftLeft 

Soft left key

SoftRight 

Soft right key

Call 

Call key

EndCall 

End call key

Reserved 

400-500 reserved for dynamic keycodes

Count 

Not a key, just marks the number of scancodes for array bounds

Definition at line 45 of file keyboard_event.hpp.

Member Function Documentation

◆ getIsDownEvent()

bool utility::event::KeyboardEvent::getIsDownEvent ( void  ) const
noexcept

Check if the event is a key down event.

Returns
True if the event is a key down event, false otherwise.

Definition at line 91 of file keyboard_event.cpp.

◆ getIsRepeatEvent()

bool utility::event::KeyboardEvent::getIsRepeatEvent ( void  ) const
noexcept

Check if the event is a key repeat event.

Returns
True if the event is a key repeat event, false otherwise.

Definition at line 102 of file keyboard_event.cpp.

◆ getKeycode()

KeyboardEvent::KeyCode utility::event::KeyboardEvent::getKeycode ( void  ) const
noexcept

Get the virtual key code.

Returns
The virtual key code.

Definition at line 62 of file keyboard_event.cpp.

◆ getScancode()

KeyboardEvent::ScanCode utility::event::KeyboardEvent::getScancode ( void  ) const
noexcept

Get the keyboard scancode.

Returns
The keyboard scancode.

Definition at line 45 of file keyboard_event.cpp.

◆ isModifierSet()

bool utility::event::KeyboardEvent::isModifierSet ( const KeyModifiers  modifier) const
noexcept

Check if a specific key modifier is set.

Parameters
modifierThe key modifier to check.
Returns
True if the specified modifier is set, false otherwise.

Definition at line 76 of file keyboard_event.cpp.

◆ setIsDownEvent()

KeyboardEvent & utility::event::KeyboardEvent::setIsDownEvent ( const bool  isDown)
noexcept

Set whether the event is a key down event.

Parameters
isDownTrue if the event is a key down event, false otherwise.
Returns
Reference to this KeyboardEvent for method chaining.

Definition at line 85 of file keyboard_event.cpp.

◆ setIsRepeatEvent()

KeyboardEvent & utility::event::KeyboardEvent::setIsRepeatEvent ( const bool  isRepeat)
noexcept

Set whether the event is a key repeat event.

Parameters
isRepeatTrue if the event is a key repeat event, false otherwise.
Returns
Reference to this KeyboardEvent for method chaining.

Definition at line 96 of file keyboard_event.cpp.

◆ setKeycode()

KeyboardEvent & utility::event::KeyboardEvent::setKeycode ( const KeyCode  keycode)
noexcept

Set the virtual key code.

Parameters
keycodeThe virtual key code to set.
Returns
Reference to this KeyboardEvent for method chaining.

Definition at line 56 of file keyboard_event.cpp.

◆ setModifiers()

KeyboardEvent & utility::event::KeyboardEvent::setModifiers ( const KeyModifiers  modifiers)
noexcept

Set the key modifiers.

Parameters
modifiersThe key modifiers to set.
Returns
Reference to this KeyboardEvent for method chaining.

Definition at line 68 of file keyboard_event.cpp.

◆ setScancode()

KeyboardEvent & utility::event::KeyboardEvent::setScancode ( const ScanCode  scancode)
noexcept

Set the keyboard scancode.

Parameters
scancodeThe keyboard scancode to set.
Returns
Reference to this KeyboardEvent for method chaining.

Definition at line 50 of file keyboard_event.cpp.


The documentation for this class was generated from the following files: