aboutsummaryrefslogtreecommitdiff
path: root/docs/faq_keymap.md
diff options
context:
space:
mode:
authorskullY <skullydazed@gmail.com>2017-07-03 01:30:36 -0700
committerskullY <skullydazed@gmail.com>2017-07-03 01:30:36 -0700
commitd8e29b53fe5d57f2102b77f0ce9932cdb8b021b2 (patch)
tree14dd7d4c51a3d0bb046acb29ad96ca2b5f76f55b /docs/faq_keymap.md
parentea8df568f23b79eba13ef9e914d8b1ce94688858 (diff)
downloadqmk_firmware-d8e29b53fe5d57f2102b77f0ce9932cdb8b021b2.tar.gz
qmk_firmware-d8e29b53fe5d57f2102b77f0ce9932cdb8b021b2.zip
Update a bunch of docs
Diffstat (limited to 'docs/faq_keymap.md')
-rw-r--r--docs/faq_keymap.md94
1 files changed, 20 insertions, 74 deletions
diff --git a/docs/faq_keymap.md b/docs/faq_keymap.md
index 623726ab2..d6442ac53 100644
--- a/docs/faq_keymap.md
+++ b/docs/faq_keymap.md
@@ -1,10 +1,13 @@
1## READ FIRST 1# Frequently Asked Keymap Questions
2https://github.com/tmk/tmk_core/blob/master/doc/keymap.md
3 2
4## How to get keycode 3This page covers questions people often have about keymaps. If you haven't you should read [Keymap Overview](keymap.html) first.
5See [Keycodes](Keycodes). Keycodes are actually defined in [common/keycode.h](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/keycode.h).
6 4
7## Sysrq key 5## What Keycodes Can I Use?
6See [Basic Keycodes](keycodes.html) and [Quantum Keycodes](quantum_keycodes.html) for most of the keys you can define.
7
8Keycodes are actually defined in [common/keycode.h](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/keycode.h).
9
10## `KC_SYSREQ` isn't working
8Use keycode for Print Screen(`KC_PSCREEN` or `KC_PSCR`) instead of `KC_SYSREQ`. Key combination of 'Alt + Print Screen' is recognized as 'System request'. 11Use keycode for Print Screen(`KC_PSCREEN` or `KC_PSCR`) instead of `KC_SYSREQ`. Key combination of 'Alt + Print Screen' is recognized as 'System request'.
9 12
10See [issue #168](https://github.com/tmk/tmk_keyboard/issues/168) and 13See [issue #168](https://github.com/tmk/tmk_keyboard/issues/168) and
@@ -16,7 +19,7 @@ Use `KC_PWR` instead of `KC_POWER` or vice versa.
16- `KC_PWR` works with Windows and Linux, not with OSX. 19- `KC_PWR` works with Windows and Linux, not with OSX.
17- `KC_POWER` works with OSX and Linux, not with Windows. 20- `KC_POWER` works with OSX and Linux, not with Windows.
18 21
19http://geekhack.org/index.php?topic=14290.msg1327264#msg1327264 22More info: http://geekhack.org/index.php?topic=14290.msg1327264#msg1327264
20 23
21## Oneshot modifier 24## Oneshot modifier
22Solves my personal 'the' problem. I often got 'the' or 'THe' wrongly instead of 'The'. Oneshot Shift mitgates this for me. 25Solves my personal 'the' problem. I often got 'the' or 'THe' wrongly instead of 'The'. Oneshot Shift mitgates this for me.
@@ -32,15 +35,17 @@ For Modifier keys and layer actions you have to place `KC_TRANS` on same positio
32 35
33 36
34## Mechanical Lock Switch Support 37## Mechanical Lock Switch Support
35https://github.com/tmk/tmk_keyboard#mechanical-locking-support
36
37This feature is for *mechanical lock switch* like this Alps one.
38http://deskthority.net/wiki/Alps_SKCL_Lock
39 38
40Using enabling this feature and using keycodes `LCAP`, `LNUM` or `LSCR` in keymap you can use physical locking CapsLock, NumLock or ScrollLock keys as you expected. 39This feature is for *mechanical lock switch* like [this Alps one](http://deskthority.net/wiki/Alps_SKCL_Lock). You can enable it by adding this to your `config.h`:
40
41```
42#define LOCKING_SUPPORT_ENABLE
43#define LOCKING_RESYNC_ENABLE
44```
41 45
42Old vintage mechanical keyboards occasionally have lock switches but modern ones don't have. ***You don't need this feature in most case and just use keycodes `CAPS`, `NLCK` and `SLCK`.*** 46After enabling this feature use keycodes `KC_LCAP`, `KC_LNUM` and `KC_LSCR` in your keymap instead.
43 47
48Old vintage mechanical keyboards occasionally have lock switches but modern ones don't have. ***You don't need this feature in most case and just use keycodes `KC_CAPS`, `KC_NLCK` and `KC_SLCK`.***
44 49
45## Input special charactors other than ASCII like Cédille 'Ç' 50## Input special charactors other than ASCII like Cédille 'Ç'
46NO UNIVERSAL METHOD TO INPUT THOSE WORKS OVER ALL SYSTEMS. You have to define **MACRO** in way specific to your OS or layout. 51NO UNIVERSAL METHOD TO INPUT THOSE WORKS OVER ALL SYSTEMS. You have to define **MACRO** in way specific to your OS or layout.
@@ -111,68 +116,12 @@ https://github.com/tekezo/Karabiner/issues/403
111 116
112## Esc and `~ on a key 117## Esc and `~ on a key
113 118
114You can define FC660 and Poker style ESC with `ACTION_LAYER_MODS`. 119Use `GRAVE_ESC` or `KC_GESC` in your keymap.
115https://github.com/tmk/tmk_core/blob/master/doc/keymap.md#35-momentary-switching-with-modifiers
116
117```
118#include "keymap_common.h"
119
120
121/* Leopold FC660
122 * https://elitekeyboards.com/products.php?sub=leopold,compact&pid=fc660c
123 * Shift + Esc = ~
124 * Fn + Esc = `
125 *
126 * Votex Poker II
127 * https://adprice.fedorapeople.org/poker2_manual.pdf
128 * Fn + Esc = `
129 * Fn + Shift + Esc = ~
130 */
131const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
132 /* 0: qwerty */
133 [0] = KEYMAP( \
134 ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, NUHS,BSPC, \
135 TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, \
136 LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT,ENT, \
137 FN0, NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH,RSFT,ESC, \
138 LCTL,LGUI,LALT, SPC, RALT,FN1, RGUI,RCTL),
139 [1] = KEYMAP( \
140 GRV, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
141 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,\
142 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
143 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
144 TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS),
145 [2] = KEYMAP( \
146 GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS,TRNS, \
147 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,\
148 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
149 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
150 TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS),
151};
152
153const uint16_t PROGMEM fn_actions[] = {
154 // https://github.com/tmk/tmk_core/blob/master/doc/keymap.md#35-momentary-switching-with-modifiers
155 [0] = ACTION_LAYER_MODS(1, MOD_LSFT),
156 [1] = ACTION_LAYER_MOMENTARY(2),
157};
158```
159
160Otherwise, you can write code, see this.
161https://github.com/p3lim/keyboard_firmware/commit/fd799c12b69a5ab5addd1d4c03380a1b8ef8e9dc
162
163
164## 32 Fn keys are not enough?
165### actionmap
166It uses 16 bit codes and has no limitation of 32 Fn at the expense of memory space. TMK keymap is actually is 8 bit codes as subset of the actionmap.
167https://github.com/tmk/tmk_keyboard/issues?utf8=%E2%9C%93&q=is%3Aissue+actionmap
168
169### extension for modified keys
170https://geekhack.org/index.php?topic=41989.msg1885526#msg1885526
171
172 120
173## Arrow on Right Modifier keys with Dual-Role 121## Arrow on Right Modifier keys with Dual-Role
174This turns right modifer keys into arrow keys when the keys are tapped while still modifiers when the keys are hold. In TMK the dual-role function is dubbed **TAP**. 122This turns right modifer keys into arrow keys when the keys are tapped while still modifiers when the keys are hold. In TMK the dual-role function is dubbed **TAP**.
175``` 123```
124
176#include "keymap_common.h" 125#include "keymap_common.h"
177 126
178 127
@@ -211,18 +160,16 @@ const uint16_t PROGMEM fn_actions[] = {
211 160
212``` 161```
213 162
214
215Dual-role key: https://en.wikipedia.org/wiki/Modifier_key#Dual-role_keys 163Dual-role key: https://en.wikipedia.org/wiki/Modifier_key#Dual-role_keys
216 164
217 165
218## Eject on Mac OSX 166## Eject on Mac OSX
219`EJCT` keycode works on OSX. https://github.com/tmk/tmk_keyboard/issues/250 167`KC_EJCT` keycode works on OSX. https://github.com/tmk/tmk_keyboard/issues/250
220It seems Windows 10 ignores the code and Linux/Xorg recognizes but has no mapping by default. 168It seems Windows 10 ignores the code and Linux/Xorg recognizes but has no mapping by default.
221 169
222Not sure what keycode Eject is on genuine Apple keyboard actually. HHKB uses `F20` for Eject key(`Fn+f`) on Mac mode but this is not same as Apple Eject keycode probably. 170Not sure what keycode Eject is on genuine Apple keyboard actually. HHKB uses `F20` for Eject key(`Fn+f`) on Mac mode but this is not same as Apple Eject keycode probably.
223 171
224 172
225
226## What's weak_mods and real_mods in action_util.c 173## What's weak_mods and real_mods in action_util.c
227___TO BE IMPROVED___ 174___TO BE IMPROVED___
228 175
@@ -262,4 +209,3 @@ if (timer_elapsed(key_timer) < 100) {
262``` 209```
263 210
264It's best to declare the `static uint16_t key_timer;` at the top of the file, outside of any code blocks you're using it in. 211It's best to declare the `static uint16_t key_timer;` at the top of the file, outside of any code blocks you're using it in.
265