← 返回命令列表

Linux command

xmodmap 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Swap

xmodmap -e 'pointer = 3 2 1'

Reassign

xmodmap -e 'keycode [keycode] = [keyname]'

Disable

xmodmap -e 'keycode [keycode] ='

Execute

xmodmap [path/to/file]

说明

xmodmap modifies keymaps and pointer button mappings in X Window System. It can remap keys, swap modifier keys, and change mouse button behavior. Common uses include swapping Caps Lock and Control, remapping special keys, or configuring multi-button mice. Changes are stored in memory and persist until the X session ends.

参数

-e _expression_
Execute the given expression
-pm
Print current modifier map
-pk
Print current keymap table
-pp
Print current pointer map
-grammar
Print expression grammar
-verbose
Verbose output
-n
Show what would be done without applying

FAQ

What is the xmodmap command used for?

xmodmap modifies keymaps and pointer button mappings in X Window System. It can remap keys, swap modifier keys, and change mouse button behavior. Common uses include swapping Caps Lock and Control, remapping special keys, or configuring multi-button mice. Changes are stored in memory and persist until the X session ends.

How do I run a basic xmodmap example?

Run `xmodmap -e 'pointer = 3 2 1'` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -e _expression_ do in xmodmap?

Execute the given expression