Kaleidoscope
Classes | Macros | Typedefs
key_defs.h File Reference
#include "HIDTables.h"
#include "key_defs_keyboard.h"
#include "key_defs_sysctl.h"
#include "key_defs_consumerctl.h"
#include "KeyboardioHID.h"
Include dependency graph for key_defs.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

union  Key_
 

Macros

#define KEY_FLAGS   B00000000
 
#define CTRL_HELD   B00000001
 
#define LALT_HELD   B00000010
 
#define RALT_HELD   B00000100
 
#define SHIFT_HELD   B00001000
 
#define GUI_HELD   B00010000
 
#define SYNTHETIC   B01000000
 
#define RESERVED   B10000000
 
#define LCTRL(k)   ((Key) { k.keyCode, k.flags | CTRL_HELD })
 
#define LALT(k)   ((Key) { k.keyCode, k.flags | LALT_HELD })
 
#define RALT(k)   ((Key) { k.keyCode, k.flags | RALT_HELD })
 
#define LSHIFT(k)   ((Key) { k.keyCode, k.flags | SHIFT_HELD })
 
#define LGUI(k)   ((Key) { k.keyCode, k.flags | GUI_HELD })
 
#define IS_SYSCTL   B00000001
 
#define IS_CONSUMER   B00000010
 
#define SWITCH_TO_KEYMAP   B00000100
 
#define IS_INTERNAL   B00001000
 
#define HID_TYPE_CL   B00000000
 
#define HID_TYPE_LC   B00000100
 
#define HID_TYPE_NARY   B00001000
 
#define HID_TYPE_OOC   B00001100
 
#define HID_TYPE_OSC   B00010000
 
#define HID_TYPE_RTC   B00010100
 
#define HID_TYPE_SEL   B00011000
 
#define MOMENTARY_OFFSET   42
 
#define KEYMAP_0   0
 
#define KEYMAP_1   1
 
#define KEYMAP_2   2
 
#define KEYMAP_3   3
 
#define KEYMAP_4   4
 
#define KEYMAP_5   5
 
#define KEYMAP_6   6
 
#define KEYMAP_7   7
 
#define KEYMAP_PREVIOUS   33
 
#define KEYMAP_NEXT   34
 
#define Key_NoKey   (Key) { 0, KEY_FLAGS }
 
#define Key_skip   (Key) { 0, KEY_FLAGS }
 
#define Key_Transparent   (Key){ .raw = 0xffff }
 
#define ___   Key_Transparent
 
#define XXX   Key_NoKey
 
#define Key_LeftParen   LSHIFT(Key_9)
 
#define Key_RightParen   LSHIFT(Key_0)
 
#define Key_LeftCurlyBracket   LSHIFT(Key_LeftBracket)
 
#define Key_RightCurlyBracket   LSHIFT(Key_RightBracket)
 
#define Key_Pipe   LSHIFT(Key_Backslash)
 
#define KEY_BACKLIGHT_DOWN   0xF1
 
#define KEY_BACKLIGHT_UP   0xF2
 
#define Key_BacklightDown   (Key) { KEY_BACKLIGHT_DOWN, KEY_FLAGS }
 
#define Key_BacklightUp   (Key) { KEY_BACKLIGHT_UP, KEY_FLAGS }
 
#define KEY_RIGHT_FN2   0xfe
 
#define Key_RFN2   (Key) { KEY_RIGHT_FN2, KEY_FLAGS }
 
#define KEY_LEFT_FN2   0xff
 
#define Key_LFN2   (Key) { KEY_LEFT_FN2, KEY_FLAGS }
 
#define Key_Keymap0   (Key) { KEYMAP_0, KEY_FLAGS | SYNTHETIC | SWITCH_TO_KEYMAP }
 
#define Key_Keymap1   (Key) { KEYMAP_1, KEY_FLAGS | SYNTHETIC | SWITCH_TO_KEYMAP }
 
#define Key_Keymap2   (Key) { KEYMAP_2, KEY_FLAGS | SYNTHETIC | SWITCH_TO_KEYMAP }
 
#define Key_Keymap3   (Key) { KEYMAP_3, KEY_FLAGS | SYNTHETIC | SWITCH_TO_KEYMAP }
 
#define Key_Keymap4   (Key) { KEYMAP_4, KEY_FLAGS | SYNTHETIC | SWITCH_TO_KEYMAP }
 
#define Key_Keymap5   (Key) { KEYMAP_5, KEY_FLAGS | SYNTHETIC | SWITCH_TO_KEYMAP }
 
#define Key_Keymap0_Momentary   (Key){ KEYMAP_0 + MOMENTARY_OFFSET, KEY_FLAGS | SYNTHETIC | SWITCH_TO_KEYMAP }
 
#define Key_Keymap1_Momentary   (Key){ KEYMAP_1 + MOMENTARY_OFFSET, KEY_FLAGS | SYNTHETIC | SWITCH_TO_KEYMAP }
 
#define Key_Keymap2_Momentary   (Key){ KEYMAP_2 + MOMENTARY_OFFSET, KEY_FLAGS | SYNTHETIC | SWITCH_TO_KEYMAP }
 
#define Key_Keymap3_Momentary   (Key){ KEYMAP_3 + MOMENTARY_OFFSET, KEY_FLAGS | SYNTHETIC | SWITCH_TO_KEYMAP }
 
#define Key_Keymap4_Momentary   (Key){ KEYMAP_4 + MOMENTARY_OFFSET, KEY_FLAGS | SYNTHETIC | SWITCH_TO_KEYMAP }
 
#define Key_Keymap5_Momentary   (Key){ KEYMAP_5 + MOMENTARY_OFFSET, KEY_FLAGS | SYNTHETIC | SWITCH_TO_KEYMAP }
 
#define Key_KeymapNext_Momentary   (Key) { KEYMAP_NEXT + MOMENTARY_OFFSET, KEY_FLAGS | SYNTHETIC | SWITCH_TO_KEYMAP }
 
#define Key_KeymapPrevious_Momentary   (Key) { KEYMAP_PREVIOUS + MOMENTARY_OFFSET, KEY_FLAGS | SYNTHETIC | SWITCH_TO_KEYMAP }
 

Typedefs

typedef union Key_ Key
 

Macro Definition Documentation

◆ ___

#define ___   Key_Transparent

◆ CTRL_HELD

#define CTRL_HELD   B00000001

◆ GUI_HELD

#define GUI_HELD   B00010000

◆ HID_TYPE_CL

#define HID_TYPE_CL   B00000000

◆ HID_TYPE_LC

#define HID_TYPE_LC   B00000100

◆ HID_TYPE_NARY

#define HID_TYPE_NARY   B00001000

◆ HID_TYPE_OOC

#define HID_TYPE_OOC   B00001100

◆ HID_TYPE_OSC

#define HID_TYPE_OSC   B00010000

◆ HID_TYPE_RTC

#define HID_TYPE_RTC   B00010100

◆ HID_TYPE_SEL

#define HID_TYPE_SEL   B00011000

◆ IS_CONSUMER

#define IS_CONSUMER   B00000010

◆ IS_INTERNAL

#define IS_INTERNAL   B00001000

◆ IS_SYSCTL

#define IS_SYSCTL   B00000001

◆ KEY_BACKLIGHT_DOWN

#define KEY_BACKLIGHT_DOWN   0xF1

◆ KEY_BACKLIGHT_UP

#define KEY_BACKLIGHT_UP   0xF2

◆ Key_BacklightDown

#define Key_BacklightDown   (Key) { KEY_BACKLIGHT_DOWN, KEY_FLAGS }

◆ Key_BacklightUp

#define Key_BacklightUp   (Key) { KEY_BACKLIGHT_UP, KEY_FLAGS }

◆ KEY_FLAGS

#define KEY_FLAGS   B00000000

◆ Key_Keymap0

#define Key_Keymap0   (Key) { KEYMAP_0, KEY_FLAGS | SYNTHETIC | SWITCH_TO_KEYMAP }

◆ Key_Keymap0_Momentary

#define Key_Keymap0_Momentary   (Key){ KEYMAP_0 + MOMENTARY_OFFSET, KEY_FLAGS | SYNTHETIC | SWITCH_TO_KEYMAP }

◆ Key_Keymap1

#define Key_Keymap1   (Key) { KEYMAP_1, KEY_FLAGS | SYNTHETIC | SWITCH_TO_KEYMAP }

◆ Key_Keymap1_Momentary

#define Key_Keymap1_Momentary   (Key){ KEYMAP_1 + MOMENTARY_OFFSET, KEY_FLAGS | SYNTHETIC | SWITCH_TO_KEYMAP }

◆ Key_Keymap2

#define Key_Keymap2   (Key) { KEYMAP_2, KEY_FLAGS | SYNTHETIC | SWITCH_TO_KEYMAP }

◆ Key_Keymap2_Momentary

#define Key_Keymap2_Momentary   (Key){ KEYMAP_2 + MOMENTARY_OFFSET, KEY_FLAGS | SYNTHETIC | SWITCH_TO_KEYMAP }

◆ Key_Keymap3

#define Key_Keymap3   (Key) { KEYMAP_3, KEY_FLAGS | SYNTHETIC | SWITCH_TO_KEYMAP }

◆ Key_Keymap3_Momentary

#define Key_Keymap3_Momentary   (Key){ KEYMAP_3 + MOMENTARY_OFFSET, KEY_FLAGS | SYNTHETIC | SWITCH_TO_KEYMAP }

◆ Key_Keymap4

#define Key_Keymap4   (Key) { KEYMAP_4, KEY_FLAGS | SYNTHETIC | SWITCH_TO_KEYMAP }

◆ Key_Keymap4_Momentary

#define Key_Keymap4_Momentary   (Key){ KEYMAP_4 + MOMENTARY_OFFSET, KEY_FLAGS | SYNTHETIC | SWITCH_TO_KEYMAP }

◆ Key_Keymap5

#define Key_Keymap5   (Key) { KEYMAP_5, KEY_FLAGS | SYNTHETIC | SWITCH_TO_KEYMAP }

◆ Key_Keymap5_Momentary

#define Key_Keymap5_Momentary   (Key){ KEYMAP_5 + MOMENTARY_OFFSET, KEY_FLAGS | SYNTHETIC | SWITCH_TO_KEYMAP }

◆ Key_KeymapNext_Momentary

#define Key_KeymapNext_Momentary   (Key) { KEYMAP_NEXT + MOMENTARY_OFFSET, KEY_FLAGS | SYNTHETIC | SWITCH_TO_KEYMAP }

◆ Key_KeymapPrevious_Momentary

#define Key_KeymapPrevious_Momentary   (Key) { KEYMAP_PREVIOUS + MOMENTARY_OFFSET, KEY_FLAGS | SYNTHETIC | SWITCH_TO_KEYMAP }

◆ KEY_LEFT_FN2

#define KEY_LEFT_FN2   0xff

◆ Key_LeftCurlyBracket

#define Key_LeftCurlyBracket   LSHIFT(Key_LeftBracket)

◆ Key_LeftParen

#define Key_LeftParen   LSHIFT(Key_9)

◆ Key_LFN2

#define Key_LFN2   (Key) { KEY_LEFT_FN2, KEY_FLAGS }

◆ Key_NoKey

#define Key_NoKey   (Key) { 0, KEY_FLAGS }

◆ Key_Pipe

#define Key_Pipe   LSHIFT(Key_Backslash)

◆ Key_RFN2

#define Key_RFN2   (Key) { KEY_RIGHT_FN2, KEY_FLAGS }

◆ KEY_RIGHT_FN2

#define KEY_RIGHT_FN2   0xfe

◆ Key_RightCurlyBracket

#define Key_RightCurlyBracket   LSHIFT(Key_RightBracket)

◆ Key_RightParen

#define Key_RightParen   LSHIFT(Key_0)

◆ Key_skip

#define Key_skip   (Key) { 0, KEY_FLAGS }

◆ Key_Transparent

#define Key_Transparent   (Key){ .raw = 0xffff }

◆ KEYMAP_0

#define KEYMAP_0   0

◆ KEYMAP_1

#define KEYMAP_1   1

◆ KEYMAP_2

#define KEYMAP_2   2

◆ KEYMAP_3

#define KEYMAP_3   3

◆ KEYMAP_4

#define KEYMAP_4   4

◆ KEYMAP_5

#define KEYMAP_5   5

◆ KEYMAP_6

#define KEYMAP_6   6

◆ KEYMAP_7

#define KEYMAP_7   7

◆ KEYMAP_NEXT

#define KEYMAP_NEXT   34

◆ KEYMAP_PREVIOUS

#define KEYMAP_PREVIOUS   33

◆ LALT

#define LALT (   k)    ((Key) { k.keyCode, k.flags | LALT_HELD })

◆ LALT_HELD

#define LALT_HELD   B00000010

◆ LCTRL

#define LCTRL (   k)    ((Key) { k.keyCode, k.flags | CTRL_HELD })

◆ LGUI

#define LGUI (   k)    ((Key) { k.keyCode, k.flags | GUI_HELD })

◆ LSHIFT

#define LSHIFT (   k)    ((Key) { k.keyCode, k.flags | SHIFT_HELD })

◆ MOMENTARY_OFFSET

#define MOMENTARY_OFFSET   42

◆ RALT

#define RALT (   k)    ((Key) { k.keyCode, k.flags | RALT_HELD })

◆ RALT_HELD

#define RALT_HELD   B00000100

◆ RESERVED

#define RESERVED   B10000000

◆ SHIFT_HELD

#define SHIFT_HELD   B00001000

◆ SWITCH_TO_KEYMAP

#define SWITCH_TO_KEYMAP   B00000100

◆ SYNTHETIC

#define SYNTHETIC   B01000000

◆ XXX

#define XXX   Key_NoKey

Typedef Documentation

◆ Key

typedef union Key_ Key