diff options
author | Ryan <fauxpark@gmail.com> | 2020-05-27 10:52:48 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-27 01:52:48 +0100 |
commit | 00c1401d3c3b6d5d672719f21795c10a387d15c8 (patch) | |
tree | f4593e05854475b2113999915f7bee8ed03ecd3c /docs/reference_keymap_extras.md | |
parent | a9b3c0a807e00e7279bb039abb5d5696ecd6d0c1 (diff) | |
download | qmk_firmware-00c1401d3c3b6d5d672719f21795c10a387d15c8.tar.gz qmk_firmware-00c1401d3c3b6d5d672719f21795c10a387d15c8.zip |
Documentation for keymap_extras (#9194)
Diffstat (limited to 'docs/reference_keymap_extras.md')
-rw-r--r-- | docs/reference_keymap_extras.md | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/docs/reference_keymap_extras.md b/docs/reference_keymap_extras.md new file mode 100644 index 000000000..4f2139249 --- /dev/null +++ b/docs/reference_keymap_extras.md | |||
@@ -0,0 +1,79 @@ | |||
1 | # Language-specific Keycodes | ||
2 | |||
3 | Keyboards are able to support a wide range of languages. However, they do not send the actual characters produced by pressing their keys - instead, they send numerical codes. In the USB HID spec, these are called "usages", although they are more often referred to as "scancodes" or "keycodes" when in the context of keyboards. | ||
4 | Less than 256 usages are defined in the HID Keyboard/Keypad usage page, and some of those do nothing on modern operating systems. So, how is this language support achieved? | ||
5 | |||
6 | In a nutshell, the operating system maps the usages it receives to the appropriate character based on the user's configured keyboard layout. For example, when a Swedish person presses the key with the `å` character printed on it, the keyboard is *actually* sending the keycode for `[`. | ||
7 | |||
8 | Obviously, this could get confusing, so QMK provides language-specific keycode aliases for many keyboard layouts. These won't do much on their own - you still have to set the matching keyboard layout in your OS settings. Think of them more as keycap labels for your keymap. | ||
9 | |||
10 | To use these, simply `#include` the corresponding [header file](https://github.com/qmk/qmk_firmware/tree/master/quantum/keymap_extras) in your `keymap.c`, and add the keycodes defined in them in place of the `KC_` prefixed ones: | ||
11 | |||
12 | |Layout |Header | | ||
13 | |---------------------------|--------------------------------| | ||
14 | |Canadian Multilingual (CSA)|`keymap_canadian_multilingual.h`| | ||
15 | |Croatian |`keymap_croatian.h` | | ||
16 | |Czech |`keymap_czech.h` | | ||
17 | |Danish |`keymap_danish.h` | | ||
18 | |Dutch (Belgium) |`keymap_belgian.h` | | ||
19 | |English (Ireland) |`keymap_irish.h` | | ||
20 | |English (UK) |`keymap_uk.h` | | ||
21 | |English (US International) |`keymap_us_international.h` | | ||
22 | |Estonian |`keymap_estonian.h` | | ||
23 | |Finnish |`keymap_finnish.h` | | ||
24 | |French |`keymap_french.h` | | ||
25 | |French (BÉPO) |`keymap_bepo.h` | | ||
26 | |French (Switzerland) |`keymap_fr_ch.h` | | ||
27 | |French (macOS, ISO) |`keymap_french_osx.h` | | ||
28 | |German |`keymap_german.h` | | ||
29 | |German (Switzerland) |`keymap_german_ch.h` | | ||
30 | |German (macOS) |`keymap_german_osx.h` | | ||
31 | |German (Neo2)* |`keymap_neo2.h` | | ||
32 | |Greek* |`keymap_greek.h` | | ||
33 | |Hungarian |`keymap_hungarian.h` | | ||
34 | |Icelandic |`keymap_icelandic.h` | | ||
35 | |Italian |`keymap_italian.h` | | ||
36 | |Italian (macOS, ANSI) |`keymap_italian_osx_ansi.h` | | ||
37 | |Italian (macOS, ISO) |`keymap_italian_osx_iso.h` | | ||
38 | |Japanese |`keymap_jp.h` | | ||
39 | |Korean |`keymap_korean.h` | | ||
40 | |Latvian |`keymap_latvian.h` | | ||
41 | |Lithuanian (ĄŽERTY) |`keymap_lithuanian_azerty.h` | | ||
42 | |Lithuanian (QWERTY) |`keymap_lithuanian_qwerty.h` | | ||
43 | |Norwegian |`keymap_norwegian.h` | | ||
44 | |Polish |`keymap_polish.h` | | ||
45 | |Portuguese |`keymap_portuguese.h` | | ||
46 | |Portuguese (Brazil) |`keymap_br_abnt2.h` | | ||
47 | |Romanian |`keymap_romanian.h` | | ||
48 | |Russian* |`keymap_russian.h` | | ||
49 | |Serbian* |`keymap_serbian.h` | | ||
50 | |Serbian (Latin) |`keymap_serbian_latin.h` | | ||
51 | |Slovak |`keymap_slovak.h` | | ||
52 | |Slovenian |`keymap_slovenian.h` | | ||
53 | |Spanish |`keymap_spanish.h` | | ||
54 | |Spanish (Dvorak) |`keymap_spanish_dvorak.h` | | ||
55 | |Swedish |`keymap_swedish.h` | | ||
56 | |Turkish (F) |`keymap_turkish_f.h` | | ||
57 | |Turkish (Q) |`keymap_turkish_q.h` | | ||
58 | |||
59 | There are also a few which are not quite language-specific, but useful if you are not using a QWERTY layout: | ||
60 | |||
61 | |Layout |Header | | ||
62 | |-------------------|------------------------| | ||
63 | |Colemak |`keymap_colemak.h` | | ||
64 | |Dvorak |`keymap_dvorak.h` | | ||
65 | |Dvorak (Programmer)|`keymap_dvp.h` | | ||
66 | |Norman |`keymap_norman.h` | | ||
67 | |Plover* |`keymap_plover.h` | | ||
68 | |Plover (Dvorak)* |`keymap_plover_dvorak.h`| | ||
69 | |Steno* |`keymap_steno.h` | | ||
70 | |Workman |`keymap_workman.h` | | ||
71 | |Workman (ZXCVM) |`keymap_workman_zxcvm.h`| | ||
72 | |||
73 | ## Sendstring Support | ||
74 | |||
75 | By default, `SEND_STRING()` assumes a US ANSI keyboard layout is set. If you are using a different layout, you can also `#include "sendstring_*.h"` (as above) in your keymap to override the lookup tables used for mapping ASCII characters to keycodes. | ||
76 | |||
77 | An important thing to note here is that `SEND_STRING()` only operates on [ASCII text](https://en.wikipedia.org/wiki/ASCII#Character_set). This means that you cannot pass it a string containing Unicode characters - this unfortunately includes accented characters that may be present in your desired layout. | ||
78 | Many layouts make certain characters, such as Grave or Tilde, available only as [dead keys](https://en.wikipedia.org/wiki/Dead_key), so you must add a space immediately after it in the string you want to send, to prevent it from potentially combining with the next character. | ||
79 | Certain other layouts have no Sendstring header as they do not use a Latin-derived alphabet (for example Greek and Russian), and thus there is no way to input most of the ASCII character set. These are marked above with a `*`. | ||