Merge pull request #998 from keyboardio/f/reorg-key-defs

Move key def sections into a subdirectory to make the codebase a bit …
pull/999/head
Gergely Nagy 4 years ago committed by GitHub
commit 7153a004dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -4,16 +4,16 @@ Eventually there should be a helpful table here with good definitions for the co
- Most of the common keyboard key codes are here:
[key_defs_keyboard.h](https://github.com/keyboardio/Kaleidoscope/blob/master/src/kaleidoscope/key_defs_keyboard.h)
[key_defs/keyboard.h](https://github.com/keyboardio/Kaleidoscope/blob/master/src/kaleidoscope/key_defs/keyboard.h)
- Key codes for system tasks like shutting down, switching windows, and moving through menus are here:
[key_defs_sysctl.h](https://github.com/keyboardio/Kaleidoscope/blob/master/src/kaleidoscope/key_defs_sysctl.h)
[key_defs/sysctl.h](https://github.com/keyboardio/Kaleidoscope/blob/master/src/kaleidoscope/key_defs/sysctl.h)
- A wide range of key codes for controlling consumer electronics, most of which are probably not relevant, are in this file:
[key_defs_consumerctl.h](https://github.com/keyboardio/Kaleidoscope/blob/master/src/kaleidoscope/key_defs_consumerctl.h)
[key_defs/consumerctl.h](https://github.com/keyboardio/Kaleidoscope/blob/master/src/kaleidoscope/key_defs/consumerctl.h)
## In-keymap chorded keys
In addition, the keys in `key_defs_keyboard.h` can be augmented with modifier macros: `LCTRL()`, `LSHIFT()`, `LALT()`, `LGUI()` and `RALT()` to add chorded keys to your keymap. For example `LCTRL(LALT(Key_Delete))` can be used to add control-alt-delete as a single key to your keymap, should you wish. The innermost bracket must be of the standard format as taken from the above key definitions, and all other modifiers must be from the aforementioned list, and in that format. This does allow you to create single keys for multiple modifiers, e.g. `LCTRL(LALT(LSHIFT(Key_LeftGui)))`, when held, would have the effect of all left modifiers at once. These modifier macros only work for standard keys! When applied to any key provided by a plugin, they will have no effect.
In addition, the keys in `key_defs/keyboard.h` can be augmented with modifier macros: `LCTRL()`, `LSHIFT()`, `LALT()`, `LGUI()` and `RALT()` to add chorded keys to your keymap. For example `LCTRL(LALT(Key_Delete))` can be used to add control-alt-delete as a single key to your keymap, should you wish. The innermost bracket must be of the standard format as taken from the above key definitions, and all other modifiers must be from the aforementioned list, and in that format. This does allow you to create single keys for multiple modifiers, e.g. `LCTRL(LALT(LSHIFT(Key_LeftGui)))`, when held, would have the effect of all left modifiers at once. These modifier macros only work for standard keys! When applied to any key provided by a plugin, they will have no effect.

@ -19,12 +19,11 @@
#include "kaleidoscope/HIDTables.h"
#include "kaleidoscope/key_defs_keyboard.h"
#include "kaleidoscope/key_defs_sysctl.h"
#include "kaleidoscope/key_defs_consumerctl.h"
#include "kaleidoscope/key_defs_keymaps.h"
#include "kaleidoscope/key_defs_aliases.h"
#include "kaleidoscope/key_defs/keyboard.h"
#include "kaleidoscope/key_defs/sysctl.h"
#include "kaleidoscope/key_defs/consumerctl.h"
#include "kaleidoscope/key_defs/keymaps.h"
#include "kaleidoscope/key_defs/aliases.h"
// -----------------------------------------------------------------------------
// Constant keycode values

@ -18,7 +18,7 @@
#pragma once
#include "kaleidoscope/key_defs_keyboard.h"
#include "kaleidoscope/key_defs/keyboard.h"
#include "Kaleidoscope.h"
// Out of order because `fix-macros.h` clears the preprocessor environment for

@ -102,10 +102,10 @@ enum { MACRO_VERSION_INFO,
* defined as part of the USB HID Keyboard specification. You can find the names
* (if not yet the explanations) for all the standard `Key_` defintions offered by
* Kaleidoscope in these files:
* https://github.com/keyboardio/Kaleidoscope/blob/master/src/key_defs_keyboard.h
* https://github.com/keyboardio/Kaleidoscope/blob/master/src/key_defs_consumerctl.h
* https://github.com/keyboardio/Kaleidoscope/blob/master/src/key_defs_sysctl.h
* https://github.com/keyboardio/Kaleidoscope/blob/master/src/key_defs_keymaps.h
* https://github.com/keyboardio/Kaleidoscope/blob/master/src/key_defs/keyboard.h
* https://github.com/keyboardio/Kaleidoscope/blob/master/src/key_defs/consumerctl.h
* https://github.com/keyboardio/Kaleidoscope/blob/master/src/key_defs/sysctl.h
* https://github.com/keyboardio/Kaleidoscope/blob/master/src/key_defs/keymaps.h
*
* Additional things that should be documented here include
* using ___ to let keypresses fall through to the previously active layer

@ -102,10 +102,10 @@ enum { MACRO_VERSION_INFO,
* defined as part of the USB HID Keyboard specification. You can find the names
* (if not yet the explanations) for all the standard `Key_` defintions offered by
* Kaleidoscope in these files:
* https://github.com/keyboardio/Kaleidoscope/blob/master/src/key_defs_keyboard.h
* https://github.com/keyboardio/Kaleidoscope/blob/master/src/key_defs_consumerctl.h
* https://github.com/keyboardio/Kaleidoscope/blob/master/src/key_defs_sysctl.h
* https://github.com/keyboardio/Kaleidoscope/blob/master/src/key_defs_keymaps.h
* https://github.com/keyboardio/Kaleidoscope/blob/master/src/key_defs/keyboard.h
* https://github.com/keyboardio/Kaleidoscope/blob/master/src/key_defs/consumerctl.h
* https://github.com/keyboardio/Kaleidoscope/blob/master/src/key_defs/sysctl.h
* https://github.com/keyboardio/Kaleidoscope/blob/master/src/key_defs/keymaps.h
*
* Additional things that should be documented here include
* using ___ to let keypresses fall through to the previously active layer

@ -102,10 +102,10 @@ enum { MACRO_VERSION_INFO,
* defined as part of the USB HID Keyboard specification. You can find the names
* (if not yet the explanations) for all the standard `Key_` defintions offered by
* Kaleidoscope in these files:
* https://github.com/keyboardio/Kaleidoscope/blob/master/src/key_defs_keyboard.h
* https://github.com/keyboardio/Kaleidoscope/blob/master/src/key_defs_consumerctl.h
* https://github.com/keyboardio/Kaleidoscope/blob/master/src/key_defs_sysctl.h
* https://github.com/keyboardio/Kaleidoscope/blob/master/src/key_defs_keymaps.h
* https://github.com/keyboardio/Kaleidoscope/blob/master/src/key_defs/keyboard.h
* https://github.com/keyboardio/Kaleidoscope/blob/master/src/key_defs/consumerctl.h
* https://github.com/keyboardio/Kaleidoscope/blob/master/src/key_defs/sysctl.h
* https://github.com/keyboardio/Kaleidoscope/blob/master/src/key_defs/keymaps.h
*
* Additional things that should be documented here include
* using ___ to let keypresses fall through to the previously active layer

Loading…
Cancel
Save