From 7adab8a43b4236d7a04e009698424578c183a353 Mon Sep 17 00:00:00 2001 From: jtroo Date: Mon, 9 Sep 2024 20:44:54 -0700 Subject: [PATCH] doc: add explicit section for key names --- docs/config.adoc | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/docs/config.adoc b/docs/config.adoc index 469affad5..9239306a4 100644 --- a/docs/config.adoc +++ b/docs/config.adoc @@ -233,6 +233,19 @@ NOTE: Please have a read through link:./platform-known-issues.adoc[the known pla because they may have implications on what you should include/exclude in `defsrc`. The Windows LLHOOK I/O mechanism has the most issues by far. +[[key-names]] +== Key names for defsrc and deflayermap +<> + +The source of truth for all default key names are the functions +`str_to_oscode` and `add_default_str_osc_mappings` +in the link:../parser/src/keys/mod.rs[keys/mod.rs file]. + +https://www.toptal.com/developers/keycode[This online tool] +will also work for most keys to tell you the key name. +It will be shown as the `event.code` field in the web page +after you press the key. + [[non-us-keyboards]] == Non-US keyboards <> @@ -245,9 +258,9 @@ The two sections below can help you understand how to remap all your keys. === Browser event.code Ensure kanata and other key remapping programs are **not** running. -Then you can use https://www.toptal.com/developers/keycode[this link] +Then you can use https://www.toptal.com/developers/keycode[this online tool] and press the key. -The `event.code` field tells you the key name. +The `event.code` field tells you the key name to use in Kanata. Alternatively, you can read through https://www.w3.org/TR/uievents-code/[this reference]. Due to the lengthy key names,