import { _ as _export_sfc, c as createElementBlock, I as createVNode, w as withCtx, a8 as createStaticVNode, D as resolveComponent, o as openBlock, l as createBaseVNode, a as createTextVNode } from "./chunks/framework.B9AX-CPi.js"; const __pageData = JSON.parse('{"title":"Unicode","description":"","frontmatter":{},"headers":[],"relativePath":"features/unicode.md","filePath":"features/unicode.md","lastUpdated":null}'); const _sfc_main = { name: "features/unicode.md" }; const _hoisted_1 = /* @__PURE__ */ createStaticVNode('
With a little help from your OS, practically any Unicode character can be input using your keyboard.
There are some limitations to this feature. Because there is no "standard" method of Unicode input across all operating systems, each of them require their own setup process on both the host and in the firmware, which may involve installation of additional software. This also means Unicode input will not "just work" when the keyboard is plugged into another device.
The core Unicode API can be used purely programmatically. However, there are also additional subsystems which build on top of it and come with keycodes to make things easier. See below for more details.
Add the following to your keymap's rules.mk
:
UNICODE_COMMON = yes
Add the following to your config.h
:
Define | Default | Description |
---|---|---|
UNICODE_KEY_MAC | KC_LEFT_ALT | The key to hold when beginning a Unicode sequence with the macOS input mode |
UNICODE_KEY_LNX | LCTL(LSFT(KC_U)) | The key to tap when beginning a Unicode sequence with the Linux input mode |
UNICODE_KEY_WINC | KC_RIGHT_ALT | The key to hold when beginning a Unicode sequence with the WinCompose input mode |
UNICODE_SELECTED_MODES | -1 | A comma separated list of input modes for cycling through |
UNICODE_CYCLE_PERSIST | true | Whether to persist the current Unicode input mode to EEPROM |
UNICODE_TYPE_DELAY | 10 | The amount of time to wait, in milliseconds, between Unicode sequence keystrokes |
If you have the Audio feature enabled on your board, you can configure it to play sounds when the input mode is changed.
Add the following to your config.h
:
Define | Default | Description |
---|---|---|
UNICODE_SONG_MAC | n/a | The song to play when the macOS input mode is selected |
UNICODE_SONG_LNX | n/a | The song to play when the Linux input mode is selected |
UNICODE_SONG_BSD | n/a | The song to play when the BSD input mode is selected |
UNICODE_SONG_WIN | n/a | The song to play when the Windows input mode is selected |
UNICODE_SONG_WINC | n/a | The song to play when the WinCompose input mode is selected |
Each of these subsystems have their own pros and cons in terms of flexibility and ease of use. Choose the one that best fits your needs.
', 17); const _hoisted_18 = /* @__PURE__ */ createBaseVNode("p", null, [ /* @__PURE__ */ createTextVNode("This is the easiest to use, albeit somewhat limited. It supports code points up to "), /* @__PURE__ */ createBaseVNode("code", null, "U+7FFF"), /* @__PURE__ */ createTextVNode(", which covers characters for most modern languages (including East Asian), as well as many symbols, but does not include emoji.") ], -1); const _hoisted_19 = /* @__PURE__ */ createBaseVNode("p", null, [ /* @__PURE__ */ createTextVNode("To enable Basic Unicode, add the following to your "), /* @__PURE__ */ createBaseVNode("code", null, "rules.mk"), /* @__PURE__ */ createTextVNode(":") ], -1); const _hoisted_20 = /* @__PURE__ */ createBaseVNode("div", { class: "language-make vp-adaptive-theme" }, [ /* @__PURE__ */ createBaseVNode("button", { title: "Copy Code", class: "copy" }), /* @__PURE__ */ createBaseVNode("span", { class: "lang" }, "make"), /* @__PURE__ */ createBaseVNode("pre", { class: "shiki shiki-themes github-light github-dark vp-code" }, [ /* @__PURE__ */ createBaseVNode("code", null, [ /* @__PURE__ */ createBaseVNode("span", { class: "line" }, [ /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#24292E", "--shiki-dark": "#E1E4E8" } }, "UNICODE_ENABLE = yes") ]) ]) ]) ], -1); const _hoisted_21 = /* @__PURE__ */ createBaseVNode("p", null, [ /* @__PURE__ */ createTextVNode("You can then add "), /* @__PURE__ */ createBaseVNode("code", null, "UC(c)"), /* @__PURE__ */ createTextVNode(" keycodes to your keymap, where "), /* @__PURE__ */ createBaseVNode("em", null, "c"), /* @__PURE__ */ createTextVNode(" is the code point of the desired character (in hexadecimal - the "), /* @__PURE__ */ createBaseVNode("code", null, "U+"), /* @__PURE__ */ createTextVNode(" prefix will not work). For example, "), /* @__PURE__ */ createBaseVNode("code", null, "UC(0x40B)"), /* @__PURE__ */ createTextVNode(" will output "), /* @__PURE__ */ createBaseVNode("a", { href: "https://unicode-table.com/en/040B/", target: "_blank", rel: "noreferrer" }, "Ћ"), /* @__PURE__ */ createTextVNode(", and "), /* @__PURE__ */ createBaseVNode("code", null, "UC(0x30C4)"), /* @__PURE__ */ createTextVNode(" will output "), /* @__PURE__ */ createBaseVNode("a", { href: "https://unicode-table.com/en/30C4", target: "_blank", rel: "noreferrer" }, "ツ"), /* @__PURE__ */ createTextVNode(".") ], -1); const _hoisted_22 = /* @__PURE__ */ createBaseVNode("p", null, [ /* @__PURE__ */ createTextVNode("Unicode Map supports all possible code points (up to "), /* @__PURE__ */ createBaseVNode("code", null, "U+10FFFF"), /* @__PURE__ */ createTextVNode("). Here, the code points are stored in a separate mapping table (which may contain at most 16,384 entries), instead of directly in the keymap.") ], -1); const _hoisted_23 = /* @__PURE__ */ createBaseVNode("p", null, [ /* @__PURE__ */ createTextVNode("To enable Unicode Map, add the following to your "), /* @__PURE__ */ createBaseVNode("code", null, "rules.mk"), /* @__PURE__ */ createTextVNode(":") ], -1); const _hoisted_24 = /* @__PURE__ */ createBaseVNode("div", { class: "language-make vp-adaptive-theme" }, [ /* @__PURE__ */ createBaseVNode("button", { title: "Copy Code", class: "copy" }), /* @__PURE__ */ createBaseVNode("span", { class: "lang" }, "make"), /* @__PURE__ */ createBaseVNode("pre", { class: "shiki shiki-themes github-light github-dark vp-code" }, [ /* @__PURE__ */ createBaseVNode("code", null, [ /* @__PURE__ */ createBaseVNode("span", { class: "line" }, [ /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#24292E", "--shiki-dark": "#E1E4E8" } }, "UNICODEMAP_ENABLE = yes") ]) ]) ]) ], -1); const _hoisted_25 = /* @__PURE__ */ createBaseVNode("p", null, [ /* @__PURE__ */ createTextVNode("Then, you will need to create a mapping table in your "), /* @__PURE__ */ createBaseVNode("code", null, "keymap.c"), /* @__PURE__ */ createTextVNode(", and (optionally) an enum for naming the array indices, like so:") ], -1); const _hoisted_26 = /* @__PURE__ */ createBaseVNode("div", { class: "language-c vp-adaptive-theme" }, [ /* @__PURE__ */ createBaseVNode("button", { title: "Copy Code", class: "copy" }), /* @__PURE__ */ createBaseVNode("span", { class: "lang" }, "c"), /* @__PURE__ */ createBaseVNode("pre", { class: "shiki shiki-themes github-light github-dark vp-code" }, [ /* @__PURE__ */ createBaseVNode("code", null, [ /* @__PURE__ */ createBaseVNode("span", { class: "line" }, [ /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#D73A49", "--shiki-dark": "#F97583" } }, "enum"), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#24292E", "--shiki-dark": "#E1E4E8" } }, " unicode_names {") ]), /* @__PURE__ */ createTextVNode("\n"), /* @__PURE__ */ createBaseVNode("span", { class: "line" }, [ /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#24292E", "--shiki-dark": "#E1E4E8" } }, " BANG,") ]), /* @__PURE__ */ createTextVNode("\n"), /* @__PURE__ */ createBaseVNode("span", { class: "line" }, [ /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#24292E", "--shiki-dark": "#E1E4E8" } }, " IRONY,") ]), /* @__PURE__ */ createTextVNode("\n"), /* @__PURE__ */ createBaseVNode("span", { class: "line" }, [ /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#24292E", "--shiki-dark": "#E1E4E8" } }, " SNEK") ]), /* @__PURE__ */ createTextVNode("\n"), /* @__PURE__ */ createBaseVNode("span", { class: "line" }, [ /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#24292E", "--shiki-dark": "#E1E4E8" } }, "};") ]), /* @__PURE__ */ createTextVNode("\n"), /* @__PURE__ */ createBaseVNode("span", { class: "line" }), /* @__PURE__ */ createTextVNode("\n"), /* @__PURE__ */ createBaseVNode("span", { class: "line" }, [ /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#D73A49", "--shiki-dark": "#F97583" } }, "const"), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#D73A49", "--shiki-dark": "#F97583" } }, " uint32_t"), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#24292E", "--shiki-dark": "#E1E4E8" } }, " PROGMEM unicode_map"), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#D73A49", "--shiki-dark": "#F97583" } }, "[]"), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#D73A49", "--shiki-dark": "#F97583" } }, " ="), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#24292E", "--shiki-dark": "#E1E4E8" } }, " {") ]), /* @__PURE__ */ createTextVNode("\n"), /* @__PURE__ */ createBaseVNode("span", { class: "line" }, [ /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#24292E", "--shiki-dark": "#E1E4E8" } }, " [BANG] "), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#D73A49", "--shiki-dark": "#F97583" } }, "="), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#D73A49", "--shiki-dark": "#F97583" } }, " 0x"), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#005CC5", "--shiki-dark": "#79B8FF" } }, "203D"), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#24292E", "--shiki-dark": "#E1E4E8" } }, ","), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#6A737D", "--shiki-dark": "#6A737D" } }, " // ‽") ]), /* @__PURE__ */ createTextVNode("\n"), /* @__PURE__ */ createBaseVNode("span", { class: "line" }, [ /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#24292E", "--shiki-dark": "#E1E4E8" } }, " [IRONY] "), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#D73A49", "--shiki-dark": "#F97583" } }, "="), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#D73A49", "--shiki-dark": "#F97583" } }, " 0x"), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#005CC5", "--shiki-dark": "#79B8FF" } }, "2E2E"), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#24292E", "--shiki-dark": "#E1E4E8" } }, ","), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#6A737D", "--shiki-dark": "#6A737D" } }, " // ⸮") ]), /* @__PURE__ */ createTextVNode("\n"), /* @__PURE__ */ createBaseVNode("span", { class: "line" }, [ /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#24292E", "--shiki-dark": "#E1E4E8" } }, " [SNEK] "), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#D73A49", "--shiki-dark": "#F97583" } }, "="), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#D73A49", "--shiki-dark": "#F97583" } }, " 0x"), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#005CC5", "--shiki-dark": "#79B8FF" } }, "1F40D"), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#24292E", "--shiki-dark": "#E1E4E8" } }, ","), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#6A737D", "--shiki-dark": "#6A737D" } }, " // 🐍") ]), /* @__PURE__ */ createTextVNode("\n"), /* @__PURE__ */ createBaseVNode("span", { class: "line" }, [ /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#24292E", "--shiki-dark": "#E1E4E8" } }, "};") ]) ]) ]) ], -1); const _hoisted_27 = /* @__PURE__ */ createBaseVNode("p", null, [ /* @__PURE__ */ createTextVNode("Finally, add "), /* @__PURE__ */ createBaseVNode("code", null, "UM(i)"), /* @__PURE__ */ createTextVNode(" keycodes to your keymap, where "), /* @__PURE__ */ createBaseVNode("em", null, "i"), /* @__PURE__ */ createTextVNode(" is an index into the "), /* @__PURE__ */ createBaseVNode("code", null, "unicode_map[]"), /* @__PURE__ */ createTextVNode(" array. If you defined the enum above, you can use those names instead, for example "), /* @__PURE__ */ createBaseVNode("code", null, "UM(BANG)"), /* @__PURE__ */ createTextVNode(" or "), /* @__PURE__ */ createBaseVNode("code", null, "UM(SNEK)"), /* @__PURE__ */ createTextVNode(".") ], -1); const _hoisted_28 = /* @__PURE__ */ createBaseVNode("h4", { id: "unicodemap-pairs", tabindex: "-1" }, [ /* @__PURE__ */ createTextVNode("Lower and Upper Case Pairs "), /* @__PURE__ */ createBaseVNode("a", { class: "header-anchor", href: "#unicodemap-pairs", "aria-label": 'Permalink to "Lower and Upper Case Pairs {#unicodemap-pairs}"' }, "") ], -1); const _hoisted_29 = /* @__PURE__ */ createBaseVNode("p", null, [ /* @__PURE__ */ createTextVNode("Some writing systems have lowercase and uppercase variants of each character, such as å and Å. To make inputting these characters easier, you can use the "), /* @__PURE__ */ createBaseVNode("code", null, "UP(i, j)"), /* @__PURE__ */ createTextVNode(" keycode in your keymap, where "), /* @__PURE__ */ createBaseVNode("em", null, "i"), /* @__PURE__ */ createTextVNode(" and "), /* @__PURE__ */ createBaseVNode("em", null, "j"), /* @__PURE__ */ createTextVNode(" are the mapping table indices of the lowercase and uppercase characters, respectively. If you're holding down Shift or have Caps Lock turned on when you press the key, the uppercase character will be inserted; otherwise, the lowercase character will be inserted.") ], -1); const _hoisted_30 = /* @__PURE__ */ createBaseVNode("div", { class: "language-c vp-adaptive-theme" }, [ /* @__PURE__ */ createBaseVNode("button", { title: "Copy Code", class: "copy" }), /* @__PURE__ */ createBaseVNode("span", { class: "lang" }, "c"), /* @__PURE__ */ createBaseVNode("pre", { class: "shiki shiki-themes github-light github-dark vp-code" }, [ /* @__PURE__ */ createBaseVNode("code", null, [ /* @__PURE__ */ createBaseVNode("span", { class: "line" }, [ /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#D73A49", "--shiki-dark": "#F97583" } }, "const"), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#D73A49", "--shiki-dark": "#F97583" } }, " uint32_t"), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#24292E", "--shiki-dark": "#E1E4E8" } }, " PROGMEM unicode_map"), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#D73A49", "--shiki-dark": "#F97583" } }, "[]"), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#D73A49", "--shiki-dark": "#F97583" } }, " ="), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#24292E", "--shiki-dark": "#E1E4E8" } }, " {") ]), /* @__PURE__ */ createTextVNode("\n"), /* @__PURE__ */ createBaseVNode("span", { class: "line" }, [ /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#24292E", "--shiki-dark": "#E1E4E8" } }, " [AE_LOWER] "), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#D73A49", "--shiki-dark": "#F97583" } }, "="), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#D73A49", "--shiki-dark": "#F97583" } }, " 0x"), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#005CC5", "--shiki-dark": "#79B8FF" } }, "00E6"), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#24292E", "--shiki-dark": "#E1E4E8" } }, ","), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#6A737D", "--shiki-dark": "#6A737D" } }, " // æ") ]), /* @__PURE__ */ createTextVNode("\n"), /* @__PURE__ */ createBaseVNode("span", { class: "line" }, [ /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#24292E", "--shiki-dark": "#E1E4E8" } }, " [AE_UPPER] "), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#D73A49", "--shiki-dark": "#F97583" } }, "="), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#D73A49", "--shiki-dark": "#F97583" } }, " 0x"), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#005CC5", "--shiki-dark": "#79B8FF" } }, "00C6"), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#24292E", "--shiki-dark": "#E1E4E8" } }, ","), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#6A737D", "--shiki-dark": "#6A737D" } }, " // Æ") ]), /* @__PURE__ */ createTextVNode("\n"), /* @__PURE__ */ createBaseVNode("span", { class: "line" }, [ /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#24292E", "--shiki-dark": "#E1E4E8" } }, "};") ]) ]) ]) ], -1); const _hoisted_31 = /* @__PURE__ */ createBaseVNode("p", null, "This is most useful when creating a keymap for an international layout with special characters. Instead of having to put the lower and upper case versions of a character on separate keys, you can have them both on the same key. This helps blend Unicode keys in with regular keycodes.", -1); const _hoisted_32 = /* @__PURE__ */ createBaseVNode("p", null, [ /* @__PURE__ */ createTextVNode("Due to keycode size constraints, "), /* @__PURE__ */ createBaseVNode("em", null, "i"), /* @__PURE__ */ createTextVNode(" and "), /* @__PURE__ */ createBaseVNode("em", null, "j"), /* @__PURE__ */ createTextVNode(" can each only refer to one of the first 128 characters in your "), /* @__PURE__ */ createBaseVNode("code", null, "unicode_map"), /* @__PURE__ */ createTextVNode(". In other words, 0 ≤ "), /* @__PURE__ */ createBaseVNode("em", null, "i"), /* @__PURE__ */ createTextVNode(" ≤ 127 and 0 ≤ "), /* @__PURE__ */ createBaseVNode("em", null, "j"), /* @__PURE__ */ createTextVNode(" ≤ 127.") ], -1); const _hoisted_33 = /* @__PURE__ */ createBaseVNode("p", null, "As with Unicode Map, the UCIS method also supports all possible code points, and requires the use of a mapping table. However, it works much differently - Unicode characters are input by replacing a typed mnemonic.", -1); const _hoisted_34 = /* @__PURE__ */ createBaseVNode("p", null, [ /* @__PURE__ */ createTextVNode("To enable UCIS, add the following to your keymap's "), /* @__PURE__ */ createBaseVNode("code", null, "rules.mk"), /* @__PURE__ */ createTextVNode(":") ], -1); const _hoisted_35 = /* @__PURE__ */ createBaseVNode("div", { class: "language-make vp-adaptive-theme" }, [ /* @__PURE__ */ createBaseVNode("button", { title: "Copy Code", class: "copy" }), /* @__PURE__ */ createBaseVNode("span", { class: "lang" }, "make"), /* @__PURE__ */ createBaseVNode("pre", { class: "shiki shiki-themes github-light github-dark vp-code" }, [ /* @__PURE__ */ createBaseVNode("code", null, [ /* @__PURE__ */ createBaseVNode("span", { class: "line" }, [ /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#24292E", "--shiki-dark": "#E1E4E8" } }, "UCIS_ENABLE = yes") ]) ]) ]) ], -1); const _hoisted_36 = /* @__PURE__ */ createBaseVNode("p", null, [ /* @__PURE__ */ createTextVNode("Then, create a mapping table in your "), /* @__PURE__ */ createBaseVNode("code", null, "keymap.c"), /* @__PURE__ */ createTextVNode(":") ], -1); const _hoisted_37 = /* @__PURE__ */ createBaseVNode("div", { class: "language-c vp-adaptive-theme" }, [ /* @__PURE__ */ createBaseVNode("button", { title: "Copy Code", class: "copy" }), /* @__PURE__ */ createBaseVNode("span", { class: "lang" }, "c"), /* @__PURE__ */ createBaseVNode("pre", { class: "shiki shiki-themes github-light github-dark vp-code" }, [ /* @__PURE__ */ createBaseVNode("code", null, [ /* @__PURE__ */ createBaseVNode("span", { class: "line" }, [ /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#D73A49", "--shiki-dark": "#F97583" } }, "const"), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#005CC5", "--shiki-dark": "#79B8FF" } }, " ucis_symbol_t"), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#24292E", "--shiki-dark": "#E1E4E8" } }, " ucis_symbol_table"), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#D73A49", "--shiki-dark": "#F97583" } }, "[]"), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#D73A49", "--shiki-dark": "#F97583" } }, " ="), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#6F42C1", "--shiki-dark": "#B392F0" } }, " UCIS_TABLE"), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#24292E", "--shiki-dark": "#E1E4E8" } }, "(") ]), /* @__PURE__ */ createTextVNode("\n"), /* @__PURE__ */ createBaseVNode("span", { class: "line" }, [ /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#6F42C1", "--shiki-dark": "#B392F0" } }, " UCIS_SYM"), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#24292E", "--shiki-dark": "#E1E4E8" } }, "("), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#032F62", "--shiki-dark": "#9ECBFF" } }, '"poop"'), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#24292E", "--shiki-dark": "#E1E4E8" } }, ", "), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#D73A49", "--shiki-dark": "#F97583" } }, "0x"), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#005CC5", "--shiki-dark": "#79B8FF" } }, "1F4A9"), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#24292E", "--shiki-dark": "#E1E4E8" } }, "),"), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#6A737D", "--shiki-dark": "#6A737D" } }, " // 💩") ]), /* @__PURE__ */ createTextVNode("\n"), /* @__PURE__ */ createBaseVNode("span", { class: "line" }, [ /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#6F42C1", "--shiki-dark": "#B392F0" } }, " UCIS_SYM"), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#24292E", "--shiki-dark": "#E1E4E8" } }, "("), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#032F62", "--shiki-dark": "#9ECBFF" } }, '"rofl"'), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#24292E", "--shiki-dark": "#E1E4E8" } }, ", "), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#D73A49", "--shiki-dark": "#F97583" } }, "0x"), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#005CC5", "--shiki-dark": "#79B8FF" } }, "1F923"), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#24292E", "--shiki-dark": "#E1E4E8" } }, "),"), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#6A737D", "--shiki-dark": "#6A737D" } }, " // 🤣") ]), /* @__PURE__ */ createTextVNode("\n"), /* @__PURE__ */ createBaseVNode("span", { class: "line" }, [ /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#6F42C1", "--shiki-dark": "#B392F0" } }, " UCIS_SYM"), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#24292E", "--shiki-dark": "#E1E4E8" } }, "("), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#032F62", "--shiki-dark": "#9ECBFF" } }, '"ukr"'), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#24292E", "--shiki-dark": "#E1E4E8" } }, ", "), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#D73A49", "--shiki-dark": "#F97583" } }, "0x"), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#005CC5", "--shiki-dark": "#79B8FF" } }, "1F1FA"), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#24292E", "--shiki-dark": "#E1E4E8" } }, ", "), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#D73A49", "--shiki-dark": "#F97583" } }, "0x"), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#005CC5", "--shiki-dark": "#79B8FF" } }, "1F1E6"), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#24292E", "--shiki-dark": "#E1E4E8" } }, "),"), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#6A737D", "--shiki-dark": "#6A737D" } }, " // 🇺🇦") ]), /* @__PURE__ */ createTextVNode("\n"), /* @__PURE__ */ createBaseVNode("span", { class: "line" }, [ /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#6F42C1", "--shiki-dark": "#B392F0" } }, " UCIS_SYM"), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#24292E", "--shiki-dark": "#E1E4E8" } }, "("), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#032F62", "--shiki-dark": "#9ECBFF" } }, '"look"'), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#24292E", "--shiki-dark": "#E1E4E8" } }, ", "), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#D73A49", "--shiki-dark": "#F97583" } }, "0x"), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#005CC5", "--shiki-dark": "#79B8FF" } }, "0CA0"), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#24292E", "--shiki-dark": "#E1E4E8" } }, ", "), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#D73A49", "--shiki-dark": "#F97583" } }, "0x"), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#005CC5", "--shiki-dark": "#79B8FF" } }, "005F"), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#24292E", "--shiki-dark": "#E1E4E8" } }, ", "), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#D73A49", "--shiki-dark": "#F97583" } }, "0x"), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#005CC5", "--shiki-dark": "#79B8FF" } }, "0CA0"), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#24292E", "--shiki-dark": "#E1E4E8" } }, ")"), /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#6A737D", "--shiki-dark": "#6A737D" } }, " // ಠ_ಠ") ]), /* @__PURE__ */ createTextVNode("\n"), /* @__PURE__ */ createBaseVNode("span", { class: "line" }, [ /* @__PURE__ */ createBaseVNode("span", { style: { "--shiki-light": "#24292E", "--shiki-dark": "#E1E4E8" } }, ");") ]) ]) ]) ], -1); const _hoisted_38 = /* @__PURE__ */ createBaseVNode("p", null, [ /* @__PURE__ */ createTextVNode("By default, each table entry may be up to three code points long. This can be changed by adding "), /* @__PURE__ */ createBaseVNode("code", null, "#define UCIS_MAX_CODE_POINTS n"), /* @__PURE__ */ createTextVNode(" to your keymap's "), /* @__PURE__ */ createBaseVNode("code", null, "config.h"), /* @__PURE__ */ createTextVNode(".") ], -1); const _hoisted_39 = /* @__PURE__ */ createBaseVNode("p", null, [ /* @__PURE__ */ createTextVNode("To invoke UCIS input, the "), /* @__PURE__ */ createBaseVNode("code", null, "ucis_start()"), /* @__PURE__ */ createTextVNode(' function must first be called (for example, in a custom "Unicode" keycode). Then, type the mnemonic for the mapping table entry (such as "rofl"), and hit Space or Enter. The "rofl" text will be backspaced and the emoji inserted.') ], -1); const _hoisted_40 = /* @__PURE__ */ createStaticVNode('Unicode input works by typing a sequence of characters, similar to a macro. However, since this sequence depends on your OS, you will need to prepare both your host machine and QMK to recognise and send the correct Unicode input sequences respectively.
To set the list of enabled input modes, add the UNICODE_SELECTED_MODES
define to your keymap's config.h
, for example:
#define UNICODE_SELECTED_MODES UNICODE_MODE_LINUX\n// or\n#define UNICODE_SELECTED_MODES UNICODE_MODE_MACOS, UNICODE_MODE_WINCOMPOSE
These modes can then be cycled through using the UC_NEXT
and UC_PREV
keycodes. You can also switch to any input mode, even if it is not specified in UNICODE_SELECTED_MODES
, using their respective keycodes.
If your keyboard has working EEPROM, it will remember the last used input mode and continue using it on the next power up. This can be disabled by defining UNICODE_CYCLE_PERSIST
to false
.
Key | Aliases | Description |
---|---|---|
UC(c) | Send Unicode code point c , up to 0x7FFF | |
UM(i) | Send Unicode code point at index i in unicode_map | |
UP(i, j) | Send Unicode code point at index i , or j if Shift/Caps is on | |
QK_UNICODE_MODE_NEXT | UC_NEXT | Cycle through selected input modes |
QK_UNICODE_MODE_PREVIOUS | UC_PREV | Cycle through selected input modes in reverse |
QK_UNICODE_MODE_MACOS | UC_MAC | Switch to macOS input |
QK_UNICODE_MODE_LINUX | UC_LINX | Switch to Linux input |
QK_UNICODE_MODE_WINDOWS | UC_WIN | Switch to Windows input |
QK_UNICODE_MODE_BSD | UC_BSD | Switch to BSD input (not implemented) |
QK_UNICODE_MODE_WINCOMPOSE | UC_WINC | Switch to Windows input using WinCompose |
QK_UNICODE_MODE_EMACS | UC_EMAC | Switch to emacs (C-x-8 RET ) |
uint8_t get_unicode_input_mode(void)
Get the current Unicode input mode.
The currently active Unicode input mode.
void set_unicode_input_mode(uint8_t mode)
Set the Unicode input mode.
uint8_t mode
void unicode_input_mode_step(void)
Change to the next Unicode input mode.
void unicode_input_mode_step_reverse(void)
Change to the previous Unicode input mode.
void unicode_input_mode_set_user(uint8_t input_mode)
User-level callback, invoked when the input mode is changed.
uint8_t input_mode
void unicode_input_mode_set_kb(uint8_t input_mode)
Keyboard-level callback, invoked when the input mode is changed.
uint8_t input_mode
void unicode_input_start(void)
Begin the Unicode input sequence. The exact behavior depends on the currently selected input mode:
UNICODE_KEY_MAC
UNICODE_KEY_LNX
UNICODE_KEY_WINC
, then UThis function is weakly defined, and can be overridden in user code.
void unicode_input_finish(void)
Complete the Unicode input sequence. The exact behavior depends on the currently selected input mode:
UNICODE_KEY_MAC
This function is weakly defined, and can be overridden in user code.
void unicode_input_cancel(void)
Cancel the Unicode input sequence. The exact behavior depends on the currently selected input mode:
UNICODE_KEY_MAC
This function is weakly defined, and can be overridden in user code.
void register_unicode(uint32_t code_point)
Input a single Unicode character. A surrogate pair will be sent if required by the input mode.
uint32_t code_point
void send_unicode_string(const char *str)
Send a string containing Unicode characters.
const char *str
uint8_t unicodemap_index(uint16_t keycode)
Get the index into the unicode_map
array for the given keycode, respecting shift state for pair keycodes.
uint16_t keycode
An index into the unicode_map
array.
uint32_t unicodemap_get_code_point(uint8_t index)
Get the code point for the given index in the unicode_map
array.
uint8_t index
unicode_map
array.A Unicode code point value.
void register_unicodemap(uint8_t index)
Send the code point for the given index in the unicode_map
array.
uint8_t index
unicode_map
array.void ucis_start(void)
Begin the input sequence.
bool ucis_active(void)
Whether UCIS is currently active.
true
if UCIS is active.
uint8_t ucis_count(void)
Get the number of characters in the input sequence buffer.
The current input sequence buffer length.
bool ucis_add(uint16_t keycode)
Add the given keycode to the input sequence buffer.
uint16_t keycode
KC_A
and KC_Z
, or KC_1
and KC_0
.true
if the keycode was added.
bool ucis_remove_last(void)
Remove the last character from the input sequence buffer.
true
if the sequence was not empty.
void ucis_finish(void)
Mark the input sequence as complete, and attempt to match.
void ucis_cancel(void)
Cancel the input sequence.
void register_ucis(void)
Send the code point(s) for the given UCIS index.
uint8_t index