Does anyone know how to make use of the F-Lock key on a Logitech to have access to more keyboard shortcuts? For example, my F10 key has an F-Lock function labeled 'My Docs' and I want to make it open nautilus or rox in my home directory when F-Lock and F10 are used. GNOME keyboard shortcuts doesn't seem to read a different keycode when used with or without F-Lock.
Try with xbindkeys. Maybe there's another way.
Just use lineak
pacman -S lineakd
Works pretty well with the media keys...;)
"No limits. No fears. No substitutes."
If you can get it's keycode, bind the keycode to F13 with xmodmap, and then it should work.
Isn't there a command that you can issue that will monitor incoming keyboard commands and print the key code for each key you press? I vaguely remember reading about there being one, but I can't recall where...
hmm... well, xev shows the same keycode for the f-lock functions and the original keys. maybe the f-lock key only flags something in the logitech keyboard driver under windows. seems there is no way to tell the difference between F9 and F-Lock F9. both are just reported as F9.
also, the F-Lock key does not even report a keypress in xev.
to get the key code.
I also have logitech keyboard with the F-Lock key and it seems that F-Lock acts more as a numlock-like toggle key, rather than a modifier key like Alt or Control. When I press the F-Lock key, a little green led lights up (similar to pressing numlock or capslock) and it allows me to use my F keys. If I don't toggle the F-Lock key on, then neither xev or xbindkeys or anything else I've tried will recognize any keypresses involving the F1-F12. If the F-Lock is toggled on, however, they keys are recognized as F1-F12 by whatever keybinding or key recognizing program I want to use.
i forgot to say that this is the wireless version and thus doesn't have any status leds on it.
--- edit ---
i tried xbindkeys -mk and it still says that i'm only pressing the F9-F12 keys regardless of F-lock state.
I have logitech cordless desktop mx (with mx700 mouse) and I managed to have all extra keys working.
What keyboard model do you have? For some of them it's easier to setup XkbModel in /etc/X11/xorg.conf (available configs are in /etc/X11/xkb/symbols/inet).
If your model is not on the list or you can't see a symbol or a keycode in xev when you press a key then you need to bind its scancode to kernel keycode and then to X keycode at least (kernel keycode is usually different than X keycode).
Press extra keys one by one and browse your logs. If you can see any messages about scancodes you need to chose a second method.
This is what I use in my configs:
Section "InputDevice" Identifier "LogitechCordlessDesktopMX" Driver "kbd" Option "CoreKeyboard" Option "AutoRepeat" "500 30" Option "XkbRules" "xfree86" Option "XkbModel" "pc104" Option "XkbLayout" "pl" EndSection
Many extra keys on my keyboard didn't have kernel keycodes so I put these commands in my /etc/rc.local:
# Messenger/SMS setkeycodes e011 120 # Webcam setkeycodes e012 122 # iTouch setkeycodes e013 123 # Shopping setkeycodes e014 129 # LeftWheelPress setkeycodes e016 130 # F-Lock off F1 New setkeycodes e03b 131 # F-Lock off F2 Reply setkeycodes e03c 132 # F-Lock off F3 Forward setkeycodes e03d 133 # F-Lock off F4 Send setkeycodes e03e 134 # F-Lock off F5 Undo setkeycodes e03f 135 # F-Lock off F6 Redo setkeycodes e040 136 # F-Lock off F7 Print setkeycodes e041 137 # F-Lock off F8 Save setkeycodes e042 138 # F-Lock off F9 My Computer setkeycodes e043 139 # F-Lock off F10 Documents setkeycodes e044 141 # F-Lock off F11 Pictures setkeycodes e057 144 # F-Lock off F12 Music setkeycodes e058 145
You can get unrecognized scancodes (hex values) from the logs or you can use showkey -s (I'd recommend using it under console not in xterm). Showkey command stops automatically after 10 sec of keyboard inactivity.
To bind a scancode to kernel keycode you need to run first getkeycodes (look under "Escaped scancodes"). The scancodes that kernel complains about have 0 as keycode. You need to assign a value which is not already used (find unused values between 125-240 and chose the one you like). When you run setkeycode the ouput of getkeycodes should change.
Now all my extra keys have kernel keycodes. They also have keycodes under X but different from kernel keycodes (don't ask :-)). You can see these keycodes in xev.
This is enugh to use extra keys in X because most programs can just use X keycodes. But you can do more and assign symbols to X keycodes using xmodmap. The list of available symbols is in /usr/X11R6/lib/X11/XKeysymDB. Symbols are much more comfortable than pure keycodes. In fact in XkbModel variable mentioned above you can assign one of the ready to use maps. These maps are borrowed from lineak project. You can submit your map too if it's not already there. I followed examples and made my own symbol map. This is my ~/.Xmodmap file:
! keycode = keysym keycode 233 = XF86Forward keycode 234 = XF86Back keycode 134 = XF86ScrollClick keycode 223 = XF86Standby keycode 236 = XF86Mail keycode 139 = XF86Messenger keycode 209 = XF86WebCam keycode 144 = XF86AudioPrev keycode 153 = XF86AudioNext keycode 162 = XF86AudioPlay keycode 164 = XF86AudioStop keycode 237 = XF86AudioMedia keycode 160 = XF86AudioMute keycode 174 = XF86AudioLowerVolume keycode 176 = XF86AudioRaiseVolume keycode 210 = XF86VendorHome keycode 229 = XF86Search keycode 133 = XF86Shop keycode 230 = XF86Favorites keycode 178 = XF86HomePage keycode 135 = XF86New keycode 140 = XF86Reply keycode 248 = XF86MailForward keycode 191 = XF86Send keycode 192 = Undo keycode 122 = Redo keycode 188 = Print keycode 245 = XF86Save keycode 158 = XF86MyComputer keycode 193 = XF86Documents keycode 198 = XF86Pictures keycode 199 = XF86Music ! MX700 mouse config pointer = 1 2 3 6 7 4 5
I run xmodmap from ~/.xinitrc.
Now xev shows symbols for all extra keys.
The rest depends on your WM/DE. Some of them can bind a key to an action some can't. I'm currently using xbindkeys (from ~/.xinitrc too). This is part of my ~/.xbindkeysrc:
"xvkbd -xsendevent -text "[Alt_L][Right]"" XF86Forward "xvkbd -xsendevent -text "[Alt_L][Right]"" m:0x10+b:7 "xvkbd -xsendevent -text "[Alt_L][Left]"" XF86Back "xvkbd -xsendevent -text "[Alt_L][Left]"" m:0x10+b:6 "xchat" XF86Messenger "psi" Control+XF86Messenger "gmplayer -display :0.1 -fs" XF86WebCam "gmplayer -display :0.0" Control+XF86WebCam "beep-media-player -r" XF86AudioPrev "beep-media-player -f" XF86AudioNext "beep-media-player -t" XF86AudioPlay "beep-media-player -s" XF86AudioStop "beep-media-player -m" XF86AudioMedia "mute" XF86AudioMute "aumix -v-5" XF86AudioLowerVolume "aumix -v+5" XF86AudioRaiseVolume "opera -newpage" XF86HomePage "firefox" Control+XF86HomePage
It is also possible to bind a command to a key under console (man loadkeys).
thanks... i'll have to give this a shot.