Linux command
keyd 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Start
systemctl enable keyd --now
Example
sudo keyd monitor
Example
sudo keyd monitor -t
Reload
sudo keyd reload
List
keyd list-keys
Example
sudo keyd bind "[pressed_key] = [output_key]"
Reset
sudo keyd bind reset
Input
sudo keyd input "[text]"
说明
keyd is a key remapping daemon that operates at the kernel level using evdev. It allows remapping keys system-wide, independent of the display server (works with X11, Wayland, and virtual consoles). Configuration files in /etc/keyd/ define key mappings, layers, and macros. The daemon intercepts input events and transforms them according to the configuration before passing them to applications. Features include layering, oneshot modifiers, and macros.
参数
- monitor -t
- Display keypress information in real-time. If -t is supplied, also prints time since the last event in milliseconds.
- listen
- Print layer state changes of the running keyd daemon to stdout. Useful for scripting.
- reload
- Reset bindings and reload configuration from /etc/keyd.
- list-keys
- Display all valid key names.
- bind reset|_BINDING_ _BINDING_...
- Apply the supplied key bindings, or reset all bindings.
- input -t _timeout_ _text_ _text_...
- Input the supplied text as keyboard events. If no arguments are given, read from stdin. Timeout in microseconds sets delay between emitted events.
- -v, --version
- Print the current version and exit.
- -h, --help
- Print help and exit.
FAQ
What is the keyd command used for?
keyd is a key remapping daemon that operates at the kernel level using evdev. It allows remapping keys system-wide, independent of the display server (works with X11, Wayland, and virtual consoles). Configuration files in /etc/keyd/ define key mappings, layers, and macros. The daemon intercepts input events and transforms them according to the configuration before passing them to applications. Features include layering, oneshot modifiers, and macros.
How do I run a basic keyd example?
Run `systemctl enable keyd --now` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does monitor -t do in keyd?
Display keypress information in real-time. If -t is supplied, also prints time since the last event in milliseconds.