lk/hardware/keyboard.md

66 lines
1.1 KiB
Markdown
Raw Normal View History

2025-02-07 16:42:10 +00:00
---
title: "keyboard"
2025-02-11 19:47:50 +00:00
tags: [ "keyboard", "vim" ]
2025-02-07 16:42:10 +00:00
---
# System-Wide Capslock and Escape Swap
This works everywhere, including in a bare-ass tty.
Select a keymap, and create a new custom map.
2025-02-12 21:50:27 +00:00
```sh
2025-02-07 16:42:10 +00:00
su root
basemap=/usr/share/kbd/keymaps/i386/qwerty/pl1.map.gz
newmap=/usr/share/kbd/keymaps/custom.map.gz
gunzip -c $basemap | \
sed 's/Caps_Lock/\n/g;s/Escape/Caps_Lock/g;s/\n/Escape/g' | \
gzip > $newmap
```
Tell the system to use this keymap at startup by naming it in the `rc.conf` file:
2025-02-12 21:50:27 +00:00
```sh
2025-02-07 16:42:10 +00:00
echo "KEYMAP=$newmap" >> /etc/rc.conf
cat /etc/rc.conf
reboot
```
# Set Layout with X Display
Set layout to British English.
2025-02-12 21:50:27 +00:00
```sh
2025-02-07 16:42:10 +00:00
setxkbmap -layout gb
```
Or Polish with:
2025-02-12 21:50:27 +00:00
```sh
2025-02-07 16:42:10 +00:00
setxkbmap -layout pl
```
| Language | short |
2025-02-12 21:50:27 +00:00
|:---------|:------|
| Polish | `pl` |
| Serbian | `rs` |
2025-02-07 16:42:10 +00:00
Set 'alt + shift', as the command which cycles through the British English, Polish and Serbian keyboard layout.
2025-02-12 21:50:27 +00:00
```sh
2025-02-07 16:42:10 +00:00
setxkbmap -layout gb,pl,rs -option grp:alt_shift_toggle
```
## Alt_GR
Remap, e.g., the right Windows key, to Alt_Gr.
```
key <RWIN> {[ ISO_Level3_Shift ]};
```