version 1.1, 2011/11/20 20:55:21
|
version 1.2, 2012/02/05 07:14:36
|
Line 1
|
Line 1
|
How to readjust your keyboard map to your liking.
|
How to readjust your keyboard map to your liking. |
|
|
**Contents**
|
**Contents** |
|
|
[[!toc]]
|
[[!toc]] |
|
|
# Introduction
|
# Introduction |
|
|
Sometimes, esp. when working in an X environment, the default keyboard layouts aren't enough...
|
Sometimes, esp. when working in an X environment, the default keyboard layouts aren't enough... |
|
|
# xbindkeys
|
# xbindkeys |
|
|
* Program that allows you to launch shell commands with your keyboard or mouse under X. It links commands to keys or mouse buttons.
|
* Program that allows you to launch shell commands with your keyboard or mouse under X. It links commands to keys or mouse buttons. |
|
|
cd /usr/pkgsrc/x11/xbindkeys
|
cd /usr/pkgsrc/x11/xbindkeys |
make install clean
|
make install clean |
|
|
|
|
Create a default file
|
Create a default file |
|
|
xbindkeys --defaults > $HOME/.xbindkeysrc
|
xbindkeys --defaults > $HOME/.xbindkeysrc |
|
|
|
|
Grab a key code
|
Grab a key code |
|
|
xbindkeys -k
|
xbindkeys -k |
|
|
|
|
or
|
or |
|
|
xbindkeys -mk
|
xbindkeys -mk |
|
|
|
|
for multi-keys respectively.
|
for multi-keys respectively. |
|
|
## Examples
|
## Examples |
|
|
* .xbindkeysrc
|
* .xbindkeysrc |
|
|
# control+shift+d starts an xterm (it's a comment)
|
# control+shift+d starts an xterm (it's a comment) |
"xterm"
|
"xterm" |
control+shift + q
|
control+shift + q |
# Menu key starts xbindkeys_show
|
# Menu key starts xbindkeys_show |
"xbindkeys_show"
|
"xbindkeys_show" |
Menu
|
Menu |
# Control + mouse button 1 starts an xterm
|
# Control + mouse button 1 starts an xterm |
"xterm"
|
"xterm" |
Control + b:1
|
Control + b:1 |
# Control+Shift+a release event starts rxvt
|
# Control+Shift+a release event starts rxvt |
"rxvt"
|
"rxvt" |
release+control+shift + a
|
release+control+shift + a |
# Control + mouse button 2 release event starts rxvt
|
# Control + mouse button 2 release event starts rxvt |
"rxvt"
|
"rxvt" |
Control + b:2 + Release
|
Control + b:2 + Release |
|
|
|
|
# xmodmap
|
# xmodmap |
|
|
* X utility for modifying keymaps and pointer button mappings. Call it from .xinitrc or .xsession, depending on whether you use 'startx' or the X display manager, like:
|
* X utility for modifying keymaps and pointer button mappings. Call it from .xinitrc or .xsession, depending on whether you use 'startx' or the X display manager, like: |
|
|
xmodmap ~/.xmodmaprc
|
xmodmap ~/.xmodmaprc |
|
|
|
|
## German umlauts with en_US keyboards
|
## German umlauts with en_US keyboards |
|
|
* I use the [right-Alt]+[vowel] key combination. For that, add the following to your .xmodmaprc
|
* I use the [right-Alt]+[vowel] key combination. For that, add the following to your .xmodmaprc |
|
|
! Alt_R + aAeEoOuUs für Umlaute auf US-Tastaturen.
|
! Alt_R + aAeEoOuUs für Umlaute auf US-Tastaturen. |
clear mod1
|
clear mod1 |
add mod1 = Alt_L
|
add mod1 = Alt_L |
add mod3 = Alt_R
|
add mod3 = Alt_R |
keysym Alt_R = Mode_switch
|
keysym Alt_R = Mode_switch |
keysym u = u U udiaeresis Udiaeresis
|
keysym u = u U udiaeresis Udiaeresis |
keysym a = a A adiaeresis Adiaeresis
|
keysym a = a A adiaeresis Adiaeresis |
keysym o = o O odiaeresis Odiaeresis
|
keysym o = o O odiaeresis Odiaeresis |
keysym s = s S ssharp
|
keysym s = s S ssharp |
|
|
|
|
## Swap Caps_Lock and Control_L
|
## Swap Caps_Lock and Control_L |
|
|
* This comes in handy esp. when using Emacs, screen and similar programs.
|
* This comes in handy esp. when using Emacs, screen and similar programs. |
|
|
! Swap Caps_Lock and Control_L
|
! Swap Caps_Lock and Control_L |
remove Lock = Caps_Lock
|
remove Lock = Caps_Lock |
remove Control = Control_L
|
remove Control = Control_L |
keysym Control_L = Caps_Lock
|
keysym Control_L = Caps_Lock |
keysym Caps_Lock = Control_L
|
keysym Caps_Lock = Control_L |
add Lock = Caps_Lock
|
add Lock = Caps_Lock |
add Control = Control_L
|
add Control = Control_L |
|
|
|
|
Alternatively you can add in the InputDevice section of your keyboard in /etc/X11/xorg.conf (dunno if Xfree.conf works):
|
Alternatively you can add in the InputDevice section of your keyboard in /etc/X11/xorg.conf (dunno if Xfree.conf works): |
|
|
Option "XkbOptions" "ctrl:swapcaps"
|
Option "XkbOptions" "ctrl:swapcaps" |
|
|
|
|
## Mouse emulation mode with Num_Lock
|
## Mouse emulation mode with Num_Lock |
|
|
remove Lock = Num_Lock
|
remove Lock = Num_Lock |
add Lock = Control+Mod2 + Num_Lock
|
add Lock = Control+Mod2 + Num_Lock |