////
Commented out since it doesn't seem to add anything for now, but maybe in the future
:sectlinks:
:sectanchors:
////

ifdef::env-github[]
:tip-caption: :bulb:
:note-caption: :information_source:
:important-caption: :heavy_exclamation_mark:
:caution-caption: :fire:
:warning-caption: :warning:
endif::[]

= Keyboard locales

////
Commented out since doc is short enough without a ToC for the time being.
:toc:
:toc-title: pass:[<b>TABLE OF CONTENTS</b>]
:toclevels: 3
////

== ISO 100% Keyboard (event.code)

NOTE: Tested on Linux only

[%collapsible]
====
----
(defsrc
  Escape                   F1      F2     F3     F4         F5     F6     F7     F8             F9         F10            F11  F12      PrintScreen  ScrollLock  Pause
  Backquote        Digit1 Digit2 Digit3 Digit4 Digit5 Digit6 Digit7 Digit8 Digit9 Digit0       Minus       Equal         Backspace      Insert       Home        PageUp        NumLock NumpadDivide NumpadMultiply NumpadSubtract
  Tab                   KeyQ   KeyW   KeyE   KeyR   KeyT   KeyY   KeyU   KeyI   KeyO    KeyP       BracketLeft BracketRight  Enter      Delete       End         PageDown      Numpad7 Numpad8      Numpad9        NumpadAdd
  CapsLock              KeyA   KeyS   KeyD   KeyF   KeyG   KeyH   KeyJ   KeyK   KeyL   Semicolon     Quote      Backslash                                                      Numpad4 Numpad5      Numpad6
  ShiftLeft IntlBackslash  KeyZ   KeyX   KeyC   KeyV   KeyB   KeyN   KeyM   Comma  Period       Slash                   ShiftRight                   ArrowUp                   Numpad3 Numpad2      Numpad1        NumpadEnter
  ControlLeft       MetaLeft AltLeft                   Space                   AltRight       MetaRight   ContextMenu ControlRight      ArrowLeft    ArrowDown   ArrowRight    Numpad0              NumpadDecimal  
)
----
====

== ISO German QWERTZ (Windows, non-interception)[[german]]

=== Using `deflocalkeys-win`:[[german-defwin]]

[%collapsible]
====
----
(defcustomkeys
  ü    186
  +    187
  #    191
  ö    192
  ß    219
  ^    220
  ´    221
  ä    222
  <    226
)

(defsrc
  ^         1    2    3    4    5    6    7    8    9    0    ß    ´    bspc
  tab       q    w    e    r    t    z    u    i    o    p    ü    +
  caps      a    s    d    f    g    h    j    k    l    ö    ä    #    ret
  lsft <    y    x    c    v    b    n    m    ,    .    -    rsft
  lctl lmet lalt           spc            ralt rmet rctl
)
----
====

=== Without using `deflocalkeys`:[[german-nodeflocalkeys]]

[%collapsible]
====
----
(defsrc
  \         1    2    3    4    5    6    7    8    9    0    [    ]    bspc
  tab       q    w    e    r    t    z    u    i    o    p    ;    =
  caps      a    s    d    f    g    h    j    k    l    grv  '    /    ret
  lsft 102d y    x    c    v    b    n    m    ,    .    -    rsft
  lctl lmet lalt           spc            ralt rmet rctl
)
----
====

=== Example aliases[[german-aliases]]

[%collapsible]
====
----
(defalias
  ;; shifted german keys
  ! S-1
  ˝ S-2  ;; unicode 02DD ˝ look-a-like is used because @" is no valid alias, to be displayed correctly
         ;; in console requires a font that can - e.g. cascadia
  §	S-3
  $	S-4
  %	S-5
  &	S-6
  /	S-7
  ﴾	S-8  ;; unicode FD3E ﴾ look-a-like is used because @( is no valid alias, to be displayed correctly...
  ﴿	S-9  ;; unicode FD3F ﴿ look-a-like is used because @) is no valid alias, to be displayed correctly ...
  =	S-0
  ? S-ß
  * S-+
  ' S-#
  ; S-,
  : S-.
  _ S--
  > S-<
  < <   ;; not really needed but having @< and @> looks consistent

  ;; change dead keys in normal keys
  ´ (macro ´ spc )	  ;; ´ 
  ` (macro S-´ spc )  ;; `
  ^ (macro ^ spc )    ;; ^ = \ - shifting @^ will produce an incorrect space now
  ° S-^
  
  ;; AltGr german keys
  ~ A-C-+
  \ A-C-ß
  ẞ A-C-S-ß
  | A-C-<
  } A-C-0
  { A-C-7
  ] A-C-9
  [ A-C-8	
  € A-C-e
  @ A-C-q
  ² A-C-2
  ³ A-C-3
  µ A-C-m
)
----
====

== ISO German QWERTZ (MacOS)[[german]]

=== Using `deflocalkeys-macos`:[[german-defmac]]

[%collapsible]
====
----
(deflocalkeys-macos
  ß    12
  ´    13
  z    21
  ü    26
  +    27
  ö    39
  ä    40
  <    41
  #    43
  y    44
  -    53
  ^    86
)

(defsrc
  ⎋         f1   f2   f3   f4   f5   f6   f7   f8   f9   f10  f11  f12
  ^         1    2    3    4    5    6    7    8    9    0    ß    ´    ⌫
  ↹         q    w    e    r    t    z    u    i    o    p    ü    +
  ⇪         a    s    d    f    g    h    j    k    l    ö    ä    #    ↩
 ‹⇧   <     y    x    c    v    b    n    m    ,    .    -         ▲    ⇧›
  fn       ‹⌃   ‹⌥   ‹⌘              ␣              ⌘›   ⌥›   ◀    ▼    ▶
)
----
====

== ISO French Azerty (MacOS)[[french]]

=== Using `deflocalkeys-macos`:[[french-defmac]]

[%collapsible]
====
----
(deflocalkeys-macos
  @    50
  par  12 ;; Close parentheses
  -    13
  ^    73
  $    164
  ù    85
  `    192
  <    41
  /    191
  =    53
  a    16
  q    30
  z    17
  w    44
  m    39
)

(defsrc
  ⎋         f1   f2   f3   f4   f5   f6   f7   f8   f9  f10   f11  f12
  @         1    2    3    4    5    6    7    8    9    0    par   -    ⌫
  ↹         a    z    e    r    t    y    u    i    o    p     ^    $
  ⇪         q    s    d    f    g    h    j    k    l    m     ù    `    ↩
 ‹⇧   <     w    x    c    v    b    n    ,    .    /    =          ▲    ⇧›
  fn       ‹⌃   ‹⌥   ‹⌘              ␣              ⌘›   ⌥›    ◀    ▼    ▶
)
----
====

== ISO French AZERTY (Windows, non-interception)[[french]]

NOTE: This is for the https://kbdlayout.info/kbdfr?arrangement=ISO105[French AZERTY layout] (ISO105 arrangement). Tested on Windows only.

[%collapsible]
====
----
(deflocalkeys-win
	k252 223 ;; ref to the key [!] (VK_OEM_8)
)

(defsrc ;; french
  '        1     2     3     4     5     6     7     8     9     0      [    eql        bspc
  tab       a     z     e     r     t     y     u     i     o     p      ]     ;
  caps       q     s     d     f     g     h     j     k     l     m      `     bksl     ret
  lsft nubs   w     x     c     v     b     n     comm  .     /     k252                rsft
  lctl    lmet   lalt           spc                             ralt                    rctl
)
----
====

== ISO Turkish QWERTY (Linux)[[turkish]]

NOTE: This is for the https://kbdlayout.info/kbdtuq?arrangement=ISO105[Turkish QWERTY layout] (ISO105 arrangement). Tested on Linux only.

[%collapsible]
====
----
(deflocalkeys-linux
	* 	12
	- 	13
	ı 	23
	ğ 	26
	ü 	27
	ş 	39
	İ 	40
	, 	43
	< 	86
	ö 	51
	ç 	52
	. 	53
)

(defsrc ;; turkish-iso105
	grv  	1	2	3	4	5	6	7	8	9	0	*	-	bspc
	tab  	q	w	e	r	t	y	u	ı	o	p	ğ	ü
	caps 	a	s	d	f	g	h	j	k	l	ş	İ	,	ret
	lsft 	<	z	x	c	v	b	n	m	ö	ç	.		rsft
	lctl	lmet	lalt				spc					ralt	rmet	rctl
)

;; We use İ instead of i because kanata doesn't allow using i in deflocalkeys, as it is a default key name.
----
====

== ABNT2 Brazillian Portuguese QWERTY (Linux)[[portuguese]]

NOTE: This is for the https://kbdlayout.info/kbdbr[ABNT2 QWERTY layout]. Tested on Linux only.

[%collapsible]
====
----
(deflocalkeys-linux
  ´ 26
  [ 27
  ç 39
  ~ 40
  ' 41
  ] 43
  ; 53
  \ 86
  / 89
)

(defsrc ;; brazillian-abnt2
  esc  f1    f2   f3   f4   f5   f6   f7   f8   f9   f10  f11  f12 
  '    1     2    3    4    5    6    7    8    9    0    -    =   bspc
  tab  q     w    e    r    t    y    u    i    o    p    ´    [   ret
  caps a     s    d    f    g    h    j    k    l    ç    ~    ]  
  lsft \     z    x    c    v    b    n    m    ,    .    ;    rsft
  lctl lmet  lalt           spc            ralt      /
)
----
====

== ISO Swedish QWERTY (Linux)[[swedish]]

[%collapsible]
====
----
;; Swedish ISO105
(deflocalkeys-linux
  §   41
  +   12
  ´   13 ;; Acute accent. Opposite to the grave accent (grv).
  å   26
  ¨   27
  ö   39
  ä   40
  '   43
  <   86
  ,   51
  .   52
  -   53
)

(defsrc ;; Swedish ISO105
  §    1    2    3    4    5    6    7    8    9    0    +    ´    bspc
  tab  q    w    e    r    t    y    u    i    o    p    å    ¨
  caps a    s    d    f    g    h    j    k    l    ö    ä    '    ret
  lsft <    z    x    c    v    b    n    m    ,    .    -         rsft
  lctl lmet lalt                spc                 ralt rmet menu rctl
)

;; Empty layer that matches the Swedish layout
(deflayer default
  _    _    _    _    _    _    _    _    _    _    _    _    _    _
  _    _    _    _    _    _    _    _    _    _    _    _    _
  _    _    _    _    _    _    _    _    _    _    _    _    _    _
  _    _    _    _    _    _    _    _    _    _    _    _         _
  _    _    _                   _                   _    _    _    _
)
----
====


== Swedish QWERTY Localkeys (Windows)[[swedish]]

[%collapsible]
====
----
(deflocalkeys-win
  §   220
  +   187
  ´   219
  å   221
  ¨   186
  ö   192
  ä   222
  '   191
  <   226
  ,   188
  .   190
  -   189
)
----
====
