Blog pasjonaty Linux (Debian, Mint, Ubuntu) oraz webmastering z Linuksem
Testowanie i mapowanie klawiszy w Linuksie
Aby utworzyć skrót lub zdarzenie do klawiszy funkcyjnych, potrzebujemy najpierw ustalić tzw. keycode
Jak sprawdzić wartość keycode do poszczególnych klawiszy?
Sposób I.
xev -event keyboard
admin@PU551:~$ xev -event keyboard
Outer window is 0x3800001, inner window is 0x3800002
KeymapNotify event, serial 24, synthetic NO, window 0x0,
keys: 4294967199 0 0 0 16 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
KeyRelease event, serial 25, synthetic NO, window 0x3800001,
root 0xd4, subw 0x0, time 34144487, (268,-279), root:(269,129),
state 0x10, keycode 36 (keysym 0xff0d, Return), same_screen YES,
" XLookupString gives 1 bytes: (0d) "
XFilterEvent returns: False
KeymapNotify event, serial 26, synthetic NO, window 0x0,
keys: 4294967252 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
KeyRelease event, serial 28, synthetic NO, window 0x3800001,
root 0xd4, subw 0x0, time 34148415, (268,-279), root:(269,129),
state 0x10, keycode 122 (keysym 0x1008ff11, XF86AudioLowerVolume), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
^C
Sposób II.
Najlepiej bezpośrednio w trybie tekstowym (ctrl+alt+f1)
showkey -k
-h –help display this help text
-a –ascii display the decimal/octal/hex values of the keys
-s –scancodes display only the raw scan-codes
-k –keycodes display only the interpreted keycodes (default)
Sposób III.
admin@PU551:~$ xbindkeys -k
Press combination of keys or/and click under the window.
You can use one of the two lines after "NoCommand"
in $HOME/.xbindkeysrc to bind a key.
"NoCommand"
m:0x10 + c:122
Mod2 + XF86AudioLowerVolume
źródła:
http://www.fascinatingcaptain.com/howto/remap-keyboard-keys-for-ubuntu/
Sposób IV.
admin@PU551:~$ xmodmap -pke | grep Brig keycode 232 = XF86MonBrightnessDown NoSymbol XF86MonBrightnessDown keycode 233 = XF86MonBrightnessUp NoSymbol XF86MonBrightnessUp keycode 237 = XF86KbdBrightnessDown NoSymbol XF86KbdBrightnessDown
źródła:
https://wiki.archlinux.org/index.php/Xbindkeys
http://forums.fedoraforum.org/showthread.php?t=296958
http://www.pclinuxos.com/forum/index.php?topic=127998.0
Komentarze