22 return this->raw == rhs;
25 return this->raw == rhs.
raw;
32 return !(*
this == rhs);
35 return this->raw >=
raw;
38 return this->raw <=
raw;
41 return this->raw >
raw;
44 return this->raw <
raw;
47 return this->raw >= other.
raw;
50 return this->raw <= other.
raw;
53 return this->raw > other.
raw;
56 return this->raw < other.
raw;
62 #define KEY_FLAGS B00000000 63 #define CTRL_HELD B00000001 64 #define LALT_HELD B00000010 65 #define RALT_HELD B00000100 66 #define SHIFT_HELD B00001000 67 #define GUI_HELD B00010000 68 #define SYNTHETIC B01000000 69 #define RESERVED B10000000 71 #define LCTRL(k) ((Key) { k.keyCode, k.flags | CTRL_HELD }) 72 #define LALT(k) ((Key) { k.keyCode, k.flags | LALT_HELD }) 73 #define RALT(k) ((Key) { k.keyCode, k.flags | RALT_HELD }) 74 #define LSHIFT(k) ((Key) { k.keyCode, k.flags | SHIFT_HELD }) 75 #define LGUI(k) ((Key) { k.keyCode, k.flags | GUI_HELD }) 78 #define IS_SYSCTL B00000001 79 #define IS_CONSUMER B00000010 80 #define SWITCH_TO_KEYMAP B00000100 81 #define IS_INTERNAL B00001000 89 #define HID_TYPE_CL B00000000 90 #define HID_TYPE_LC B00000100 91 #define HID_TYPE_NARY B00001000 92 #define HID_TYPE_OOC B00001100 93 #define HID_TYPE_OSC B00010000 94 #define HID_TYPE_RTC B00010100 95 #define HID_TYPE_SEL B00011000 97 #define MOMENTARY_OFFSET 42 109 #define KEYMAP_PREVIOUS 33 110 #define KEYMAP_NEXT 34 113 #define Key_NoKey (Key) { 0, KEY_FLAGS } 114 #define Key_skip (Key) { 0, KEY_FLAGS } 115 #define Key_Transparent (Key){ .raw = 0xffff } 116 #define ___ Key_Transparent 117 #define XXX Key_NoKey 122 #define Key_LeftParen LSHIFT(Key_9) 123 #define Key_RightParen LSHIFT(Key_0) 124 #define Key_LeftCurlyBracket LSHIFT(Key_LeftBracket) 125 #define Key_RightCurlyBracket LSHIFT(Key_RightBracket) 127 #define Key_Pipe LSHIFT(Key_Backslash) 131 #define KEY_BACKLIGHT_DOWN 0xF1 132 #define KEY_BACKLIGHT_UP 0xF2 133 #define Key_BacklightDown (Key) { KEY_BACKLIGHT_DOWN, KEY_FLAGS } 134 #define Key_BacklightUp (Key) { KEY_BACKLIGHT_UP, KEY_FLAGS } 135 #define KEY_RIGHT_FN2 0xfe 136 #define Key_RFN2 (Key) { KEY_RIGHT_FN2, KEY_FLAGS } 137 #define KEY_LEFT_FN2 0xff 138 #define Key_LFN2 (Key) { KEY_LEFT_FN2, KEY_FLAGS } 140 #define Key_Keymap0 (Key) { KEYMAP_0, KEY_FLAGS | SYNTHETIC | SWITCH_TO_KEYMAP } 141 #define Key_Keymap1 (Key) { KEYMAP_1, KEY_FLAGS | SYNTHETIC | SWITCH_TO_KEYMAP } 142 #define Key_Keymap2 (Key) { KEYMAP_2, KEY_FLAGS | SYNTHETIC | SWITCH_TO_KEYMAP } 143 #define Key_Keymap3 (Key) { KEYMAP_3, KEY_FLAGS | SYNTHETIC | SWITCH_TO_KEYMAP } 144 #define Key_Keymap4 (Key) { KEYMAP_4, KEY_FLAGS | SYNTHETIC | SWITCH_TO_KEYMAP } 145 #define Key_Keymap5 (Key) { KEYMAP_5, KEY_FLAGS | SYNTHETIC | SWITCH_TO_KEYMAP } 146 #define Key_Keymap0_Momentary (Key){ KEYMAP_0 + MOMENTARY_OFFSET, KEY_FLAGS | SYNTHETIC | SWITCH_TO_KEYMAP } 147 #define Key_Keymap1_Momentary (Key){ KEYMAP_1 + MOMENTARY_OFFSET, KEY_FLAGS | SYNTHETIC | SWITCH_TO_KEYMAP } 148 #define Key_Keymap2_Momentary (Key){ KEYMAP_2 + MOMENTARY_OFFSET, KEY_FLAGS | SYNTHETIC | SWITCH_TO_KEYMAP } 149 #define Key_Keymap3_Momentary (Key){ KEYMAP_3 + MOMENTARY_OFFSET, KEY_FLAGS | SYNTHETIC | SWITCH_TO_KEYMAP } 150 #define Key_Keymap4_Momentary (Key){ KEYMAP_4 + MOMENTARY_OFFSET, KEY_FLAGS | SYNTHETIC | SWITCH_TO_KEYMAP } 151 #define Key_Keymap5_Momentary (Key){ KEYMAP_5 + MOMENTARY_OFFSET, KEY_FLAGS | SYNTHETIC | SWITCH_TO_KEYMAP } 153 #define Key_KeymapNext_Momentary (Key) { KEYMAP_NEXT + MOMENTARY_OFFSET, KEY_FLAGS | SYNTHETIC | SWITCH_TO_KEYMAP } 154 #define Key_KeymapPrevious_Momentary (Key) { KEYMAP_PREVIOUS + MOMENTARY_OFFSET, KEY_FLAGS | SYNTHETIC | SWITCH_TO_KEYMAP } uint16_t raw
Definition: key_defs.h:19
uint8_t keyCode
Definition: key_defs.h:16
bool operator>(const Key_ &other)
Definition: key_defs.h:52
bool operator!=(const Key_ &rhs)
Definition: key_defs.h:31
bool operator<(uint16_t raw)
Definition: key_defs.h:43
Definition: key_defs.h:13
uint8_t flags
Definition: key_defs.h:17
Key_ & operator=(uint16_t raw)
Definition: key_defs.h:27
bool operator<=(const Key_ &other)
Definition: key_defs.h:49
bool operator>=(uint16_t raw)
Definition: key_defs.h:34
bool operator==(const Key_ rhs)
Definition: key_defs.h:24
bool operator<(const Key_ &other)
Definition: key_defs.h:55
bool operator==(uint16_t rhs)
Definition: key_defs.h:21
bool operator>(uint16_t raw)
Definition: key_defs.h:40
bool operator<=(uint16_t raw)
Definition: key_defs.h:37
bool operator>=(const Key_ &other)
Definition: key_defs.h:46