If you look at /lib/udev/rules.d/60-keyboard.rules
you'll see that everything has been messed around with. This is just part of the udev merger into systemd that has gone on.
All hardware rules are compiled into a binary hardware database. These follow a really strange format. The existing rules for keyboards that ship with udev live in /lib/udev/hwdb.d/60-keyboard.hwdb
. Look at that but don't edit it (updates will probably overwrite it).
To add your custom rules, we'll create a new file in /etc/udev/hwdb.d/
by running sudoedit /etc/udev/hwdb.d/61-keyboard-local.hwdb
. All you need to do is paste in the following -
If you are using the 4000 model:
keyboard:usb:v045Ep00DB*
KEYBOARD_KEY_0c022d=pageup
KEYBOARD_KEY_0c022e=pagedown
If you are using 7000 model:
keyboard:usb:v045Ep071D*
KEYBOARD_KEY_0c022d=pageup
KEYBOARD_KEY_0c022e=pagedown
This is adapated from the tutorial you posted so you might need to tweak based on your keyboard. Look at lsusb
and make sure the vendor:product
code above (as v####p####
) is correct. It won't work if they don't match.
Once you're done editing, recompile the hwdb
that udev uses:
sudo udevadm hwdb --update
And then you might need to re-plug. If it's a PS/2 keyboard you might need to reboot. In some cases you also need to reboot.
Best Answer
What you have discovered seems to be a bug related to some applications launched from (unity)*-settings-daemon. The bug is reported here.
However, it exist multiple easy workarounds to this annoying issue;
The one I will suggest, is to define your own keyboard shortcut, and reassign the calculator button.
Another solution is to:
Use eg.
CompizConfig Setting Manager
and set theFocus Prevention Level
option to off. The option is found underGeneral Options
on the tab namedFocus & Raise Behaviour
.