I
I
Ivan Klimchuk2010-11-15 13:48:19
Keyboard
Ivan Klimchuk, 2010-11-15 13:48:19

Del key code in Ubuntu?

I bought myself an Apple Keyboard Wireless, but Ubuntu had some difficulties. And in particular, there is no Delete button on it familiar. It is, but it works through fn + Backspace, which is essentially inconvenient.
Question - is it possible to tie some multimedia key to work instead of del in the hotkey settings? And how to do it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivan Klimchuk, 2011-03-21
@Alroniks

Understood the problem. A small description of the solution.
To begin with, in the keyboard settings (System-Preferences-> Keyboard Shortcuts) we remove the hot key for the Eject action (if not removed, I did not have a key code defined)
Then you need to run the xev program in the console, move the mouse pointer over the window that appears and click on our key (most right top). The content of the form should appear: keycode 169 - the code of our key. Then everything is simple. in the console, execute the following command: If you need to change the given key to another, then using xev you can find out the name of the key. It is written after keysym. In our case, this is XF86Eject, for the Delete key it is Delete, and so on.
KeyPress event, serial 33, synthetic NO, window 0x6a00001,
root 0x1ad, subw 0x0, time 341204079, (115,93), root:(118,143),
state 0x0, keycode 169 (keysym 0x1008ff2c, XF86Eject), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 36, synthetic NO, window 0x6a00001,
root 0x1ad, subw 0x0, time 341204116, (115,93), root:(118,143),
state 0x0, keycode 169 (keysym 0x1008ff2c, XF86Eject), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False

sudo xmodmap -e 'keycode 169 = Delete'
I also redefined the F3 and F4 keys for myself. The system keys F3 and F4 only work with Fn, so you can safely use them. Now, using F3, the cursor is placed in the address bar in the browser, and using F4, the page is refreshed (F5 only works through Fn and this is inconvenient during development).
The keys F1-F2 and F5-F6 still remain unused, but Xorg does not see them for some reason, although they are defined in the kernel. But the codes from the kernel are not suitable for Xorg. So far I haven't been able to deal with them.

Z
z0rc, 2010-11-15
@z0rc

man xmodmap + www.tux.in.ua/articles/458

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question