Another hard war: ME vs MyNotebook!
Sometimes happen that if you have some multimedia keys, the system could discover them itself. If you would modify the function of that special keys, you have to read this how-to.
First of all go in System > Preferences > Keyboard Shortcut
Here there are two section: Desktop and Audio.
Go in audio and disable(click on each row that you would disable and press BACKSPACE) all keys that you would use (in my situation Play/Pause, Pause, Skip Prev/Next Track).
Now open a term and write:
xev | grep keycode | \
sed s/"^.*keycode *([0-9]+).*$"/"keycode 1 "/ | uniq
xev is used to capture the “code” for each key that we press. Press all keys that you need and after that, close the term. In output you see something like:
keycode 36
keycode 144
keycode 162
keycode 164
Exlude the first row (it’s the Enter Key). The other rows are keycodes about your keys.tutte le altre in ordine sono i keycode legati ai vostri tasti. Now modify the file xmodmap: go in your home and make a copy of your file
xmodmap -pke > xmodmap.conf
Edit it (gedit or nano or whatever you want) and insert near the Keycode that you have discovered before, a name.
For example your PLAY key have
keycode 162
Go at the row “keycode 162” and insert after the “=” a name to identify the key
keycode 162 = AudioPLAY
Repeat this for all keys that you need.
Now you have to substitute you new xmodmap.conf to the older one and you have some ways:
1) edit the file %HOME/.xsession and insert
/usr/bin/xmodmap $HOME/xmodmap.conf
2) edit the file /etc/gdm/Init/Default and substitute the row sysmodmap=/etc/X11/Xmodmap using the path of your xmodmap (for me is /home/utente/xmodmap.conf)
3) if you are luky, if you restart Gnome, it can discover the new xmodmap.conf in your home and ask to you if you would use it instead the default file
After that, open a term and launch
root:~# gconf-editor
go in /apps/metacity/keybindings_commands
Here you can set 12 commands(command_1, command_2…).
You can insert all command that you would use for your keys (start browser, pause a song, disable the sound, etc…).
Go in /apps/metacity/global_keybindings and you see run_command_1 … run_command_12 that you can use to associate a key to the command that you have write in the step before.
Near run_command_1 write the name that identify the key that you would use.
To do an Example
keycode 162 = AudioPLAY
in /apps/metacity/keybindings_commands
command_1 xmms
in /apps/metacity/global_keybindings
run_command_1 AudioPLAY
Have fun!
linux, debian, keyboard, multimedia, gnome
Recent Comments