HotkeyResearch
Fixing hotkeys
Hello Bug reporter! Thanks for your report. To be able to fix the hotkeys on your laptop we need three things:
- What the key *should* do.
- What keycode (magic number) the key produces on your laptop.
- How to identify your laptop by the manufacturer and model.
What the key should do
If you're unsure what the key is supposed to do, reboot into the originally supplied operating system (eg. Microsoft Windows or Mac OS X) and describe what action happens there.
You should also include what the 'icon' on the key looks like (eg. looks like a half moon).
What keycode is of the key
To get the magic number (keycode) of a key follow one (or more) of these methods:
Method 1
In Ubuntu with a GNOME desktop go to:
System->Preferences->Keyboard Shortcuts
Pick a random action, such as Home folder by clicking once on the Disabled text.
- Press the hotkey
Disabled should now be replaced with the magic number of the hotkey, such as 0x9f.
Method 2
Drop to the console with Ctrl-Alt-F1 and login with your username and password (Warning: Return to the graphical screen again with Ctrl-Alt-F7!)
Run:
sudo showkey -k | tee -a hotkey-log.txt
ignore the first 0x9c that may show up---this is the result of you letting go of the return key!
Pressing and letting go of the non-working hotkey should now produce output similar:
0xe0 0x1f 0xe0 0x9f
the first half are the key-press and second-half are the key-release, please report this line (a log of what you did has been saved in hotkey-log.txt to help you).
Wait 10 seconds for showkey to exit.
Method 3
Your laptop may not generate keyboard keycodes, but may instead generate ACPI events (a different way of reporting key-press events). Please do the following:
Open a Terminal, (Applications->Accessories->Terminal)
Run sudo tail -f /var/log/acpid
Press the hotkey and you may see output such as
received event "ibm/hotkey HKEY 00000080 00001010"
Finish by pressing Ctrl-c
- Please report the string between the "quote" marks.
Method 4
You can get keycode by running xev program from command line (terminal) and then pressing the special laptop keys and searching for keycode, for example output:
KeyPress event, serial 28, synthetic NO, window 0x5000001, root 0x76, subw 0x0, time 1400690129, (70,50), root:(74,102), state 0x0, keycode 223 (keysym 0x1008ff10, XF86Standby), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False KeyRelease event, serial 28, synthetic NO, window 0x5000001, root 0x76, subw 0x0, time 1400690129, (70,50), root:(74,102), state 0x0, keycode 223 (keysym 0x1008ff10, XF86Standby), same_screen YES, XLookupString gives 0 bytes:
An easier way to do this is to run:
xev | grep -A2 --line-buffered '^KeyRelease' | sed -n '/keycode /s/^.*keycode \([0-9]*\).* (.*, \(.*\)).*$/\1 \2/p'
This will only output pressed keycode and currently assigned keysym, for example:
160 XF86AudioMute 174 XF86AudioLowerVolume 176 XF86AudioRaiseVolume
Identifying your laptop
To be able to map the hotkey on your laptop correctly, we need to be able to tell if it is your laptop. Please:
Open a Terminal, (Applications->Accessories->Terminal)
Run:
sudo dmidecode -s system-manufacturer sudo dmidecode -s system-product-name sudo dmidecode -s system-version
You should see output like:
IBM 185869G ThinkPad R52
- Please report these strings, one per line.
Other sources of information
http://fedoraproject.org/wiki/SIGs/Laptop/HotKeys/KeyProcessing
http://wiki.ubuntu.org.cn/UbuntuWiki:LukaRenko/Keycodes (Source for the 4th method to get keycodes)
LaptopTestingTeam/Old/HotkeyResearch (last edited 2010-03-01 22:46:27 by 94)