Tutorials/Keyboard: Difference between revisions
(Corrected link) |
(prepared for translation) |
||
Line 1: | Line 1: | ||
<languages /> | |||
<translate> | |||
Keyboard actions are all actions that are triggered by the system when you do a keystroke. Most of them should be set by default so you are content. This article is here to help you do your own settings. Most prominent examples are the "raise audio volume" and its siblings "lower audio volume" and "mute audio" on some multimedia keyboards. | Keyboard actions are all actions that are triggered by the system when you do a keystroke. Most of them should be set by default so you are content. This article is here to help you do your own settings. Most prominent examples are the "raise audio volume" and its siblings "lower audio volume" and "mute audio" on some multimedia keyboards. | ||
= Background = | == Background == | ||
When a key is pressed, this is sent as an electronic signal over the USB or PS/2 port to the computer. There it is received by the Linux kernel and forwarded to the X Windowing system. The X Windowing system receives the ''scancodes'' of the keys being pressed and maps them to key events, for example XF86audiomute. To change this mapping you have the xmodmap command. To see the scancodes that a keypress causes, you have the xev command. In short, when you press the "Audio Mute" button on your keyboard, the kernel receives the signal from the keyboard and sends a keycode, e.g. 121, to the X Windowing System. Using its xmodmap, the Windowing System emit the signal XF86AudioMute that can be received and handled e.g. by KDE. | When a key is pressed, this is sent as an electronic signal over the USB or PS/2 port to the computer. There it is received by the Linux kernel and forwarded to the X Windowing system. The X Windowing system receives the ''scancodes'' of the keys being pressed and maps them to key events, for example XF86audiomute. To change this mapping you have the xmodmap command. To see the scancodes that a keypress causes, you have the xev command. In short, when you press the "Audio Mute" button on your keyboard, the kernel receives the signal from the keyboard and sends a keycode, e.g. 121, to the X Windowing System. Using its xmodmap, the Windowing System emit the signal XF86AudioMute that can be received and handled e.g. by KDE. | ||
= Example: The Audio Mute button = | == Example: The Audio Mute button == | ||
If your keyboard's Audio Mute button does not work, you should first find out if it really triggers the correct X Windowing System event. To do this, [[Konsole|open a console]] and enter the command | |||
If your keyboard's Audio Mute button does not work, you should first find out if it really triggers the correct X Windowing System event. To do this, [[Konsole|open a console]] and enter the command{{Input|1=xev}} | |||
Move your mouse into the Window that opens. Keep your console in your view and press a key. You will see an output like the following on your console: | Move your mouse into the Window that opens. Keep your console in your view and press a key. You will see an output like the following on your console: | ||
{{Output|1=<nowiki> | |||
KeyRelease event, serial 35, synthetic NO, window 0x4000001, | KeyRelease event, serial 35, synthetic NO, window 0x4000001, | ||
root 0x15a, subw 0x4000002, time 63106815, (43,37), root:(1279,877), | root 0x15a, subw 0x4000002, time 63106815, (43,37), root:(1279,877), | ||
state 0x10, keycode 121 (keysym 0x1008ff12, | state 0x10, keycode 121 (keysym 0x1008ff12, XF86AudioMute), same_screen YES, | ||
XLookupString gives 0 bytes: | XLookupString gives 0 bytes: | ||
XFilterEvent returns: False | XFilterEvent returns: False | ||
This means your key triggers the event XF86AudioMute. Fine, then | </nowiki>}} | ||
Choose Keyboard & Mouse -> Global Keyboard Shortcuts -> KDE Component KMix -> Mute -> Custom. Then click the button and press on the key that you want to use to mute your audio. | This means your key triggers the event XF86AudioMute. Fine, then open '''systemsettings'''. | ||
Choose <menuchoice>Keyboard & Mouse -> Global Keyboard Shortcuts -> KDE Component KMix -> Mute -> Custom</menuchoice>. Then click the button and press on the key that you want to use to mute your audio. | |||
[[Category:Tutorials]] | |||
[[Category:Configuration]] | |||
[[Category:Advanced Users]] | |||
</translate> |
Revision as of 10:31, 19 April 2011
Keyboard actions are all actions that are triggered by the system when you do a keystroke. Most of them should be set by default so you are content. This article is here to help you do your own settings. Most prominent examples are the "raise audio volume" and its siblings "lower audio volume" and "mute audio" on some multimedia keyboards.
Background
When a key is pressed, this is sent as an electronic signal over the USB or PS/2 port to the computer. There it is received by the Linux kernel and forwarded to the X Windowing system. The X Windowing system receives the scancodes of the keys being pressed and maps them to key events, for example XF86audiomute. To change this mapping you have the xmodmap command. To see the scancodes that a keypress causes, you have the xev command. In short, when you press the "Audio Mute" button on your keyboard, the kernel receives the signal from the keyboard and sends a keycode, e.g. 121, to the X Windowing System. Using its xmodmap, the Windowing System emit the signal XF86AudioMute that can be received and handled e.g. by KDE.
Example: The Audio Mute button
If your keyboard's Audio Mute button does not work, you should first find out if it really triggers the correct X Windowing System event. To do this, open a console and enter the command
xev
Move your mouse into the Window that opens. Keep your console in your view and press a key. You will see an output like the following on your console:
KeyRelease event, serial 35, synthetic NO, window 0x4000001, root 0x15a, subw 0x4000002, time 63106815, (43,37), root:(1279,877), state 0x10, keycode 121 (keysym 0x1008ff12, XF86AudioMute), same_screen YES, XLookupString gives 0 bytes: XFilterEvent returns: False
This means your key triggers the event XF86AudioMute. Fine, then open systemsettings.
Choose
. Then click the button and press on the key that you want to use to mute your audio.