I'm using a Toshiba r835 with Lubuntu. After a clean install, pressing the power button while the machine is on does nothing. I fixed the power button by following this advice:
I added these lines to ~/.config/openbox/lubuntu-rc.xml
<keybind key="XF86PowerOff">
<action name="Execute">
<command>lubuntu-logout</command>
</action>
</keybind>
This makes sense to me.
I want to map several other keys to similar shortcuts. For example, when I press Fn-F1, I want to lock the screen. I imagine I would add something like
<keybind key="XF86ScreenSaver">
<action name="Execute">
<command>xscreensaver-command -lock</command>
</action>
</keybind>
However, when I press Fn-F1, it opens the Lubuntu menu, as if I'd pressed the Super_L
key. It also types the letter l
if I have a terminal open. My desired shortcut xscreensaver-command -lock
seems to be ignored. What's going on? Why isn't my shortcut working?
I thought I could figure this out with xev, but the output of xev confuses me:
FocusOut event, serial 41, synthetic NO, window 0x2000001,
mode NotifyGrab, detail NotifyAncestor
FocusIn event, serial 41, synthetic NO, window 0x2000001,
mode NotifyUngrab, detail NotifyAncestor
KeymapNotify event, serial 41, synthetic NO, window 0x0,
keys: 0 0 0 0 0 64 0 0 0 0 0 0 0 0 0 0
32 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
MappingNotify event, serial 41, synthetic NO, window 0x0,
request MappingKeyboard, first_keycode 8, count 248
KeyPress event, serial 41, synthetic NO, window 0x2000001,
root 0xae, subw 0x0, time 16525549, (289,-138), root:(341,155),
state 0x40, keycode 160 (keysym 0x1008ff2d, XF86ScreenSaver), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 41, synthetic NO, window 0x2000001,
root 0xae, subw 0x0, time 16525550, (289,-138), root:(341,155),
state 0x40, keycode 160 (keysym 0x1008ff2d, XF86ScreenSaver), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
MappingNotify event, serial 42, synthetic NO, window 0x0,
request MappingKeyboard, first_keycode 8, count 248
KeyRelease event, serial 42, synthetic NO, window 0x2000001,
root 0xae, subw 0x0, time 16525639, (289,-138), root:(341,155),
state 0x40, keycode 46 (keysym 0x6c, l), same_screen YES,
XLookupString gives 1 bytes: (6c) "l"
XFilterEvent returns: False
KeyRelease event, serial 43, synthetic NO, window 0x2000001,
root 0xae, subw 0x0, time 16525646, (289,-138), root:(341,155),
state 0x40, keycode 133 (keysym 0xffeb, Super_L), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
It looks like I'm getting keycode 160, which I think is XF86ScreenSaver, but it's also as if I've pressed the Super_L
key and the l
key. I think all this output comes from the one Fn-F1 keypress. This confuses me. How can I get Fn-F1 to lock the screen instead of opening the Lubuntu menu and typing the letter 'l'?