Page 1 of 1

Fn+F12 hotkey not working in KDE 4.6.0

Posted: Mon Sep 26, 2011 11:05 am
by Brouwer2
Hello,

I am not entirely sure this is a T60 specific issue (except that it is an issue on my T60 :)), but hopefully someone else here has come across this and might be able to give me some pointers.

I have been using Gnome, on openSUSE 11.4, for a while now, and it works without problems on my Thinkpad T60. However, I am not a fan of what I have seen of Gnome 3, and so I thought I would give KDE a try. I installed the KDE(4.6.0) pattern from software management, and now I can log in on to the KDE desktop environment as well as Gnome. A couple of thinkpad specific things don't work however. Some of the thinkpad hotkeys don't work, but not all. In particular the Fn+F12 (hibernate) and the audio controls on the arrows. Pressing these combinations has no result, but the display brightness buttons (Fn+Home, +End), the radio switch, sleep all work. The keyboard is set to IBM Thinkpad R60/T60 etc in keyboard settings. Running xev from console shows KDE recognises the key presses, and even that they are registered as having the function they are intended to.

Here is the xev output for Fn+12:

Code: Select all


KeyPress event, serial 34, synthetic NO, window 0x5e00001,
    root 0x157, subw 0x5e00002, time 8771089, (47,22), root:(49,45),
    state 0x10, keycode 213 (keysym 0x1008ffa7, XF86Suspend), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 34, synthetic NO, window 0x5e00001,
    root 0x157, subw 0x5e00002, time 8771089, (47,22), root:(49,45),
    state 0x10, keycode 213 (keysym 0x1008ffa7, XF86Suspend), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

I thought that this might be a keyboard shortcut settings issue. In System Settings -> Shortcuts and Gestrures -> Global Shortcuts the 'KDE Daemon' shortcuts has Hibernate listed with the global shortcut. If I change that setting from the default, and enter Fn+F12 as the 'new' shortcut then the computer will hibernate. However, it does not save this across sessions. After logging out and logging back in the key won't respond again. I have tried setting a different key combination, Ctrl+F12, and again it worked in the session, but the change was not saved. After logging back in it had reset to the unresponsive default.

The audio controls I can probably live without, but the lack of a shortcut for hibernation is not great. I've looked around and it seems like KDE had hotkey issues a while back, but nothing really later than 2009. I've seen the thinkpad wiki articles on changing the hotkey masks, http://www.thinkwiki.org/wiki/How_to_ge ... key_events, but I'm out of my depth there. Any advice or pointers on the matter would be much appreciated.

Thanks in advance.

Re: Fn+F12 hotkey not working in KDE 4.6.0

Posted: Tue Sep 27, 2011 7:41 am
by Brouwer2
I am sorry I posted this in the wrong part of the forum (too little sleep...) :oops: . In checking whether anyone responded I notice I put this in the T40 part, when it should be in the T60 part.

My apologies.

Re: Fn+F12 hotkey not working in KDE 4.6.0

Posted: Tue Sep 27, 2011 9:20 pm
by RealBlackStuff
Actually, this should be in the Linux forum...

Re: Fn+F12 hotkey not working in KDE 4.6.0

Posted: Wed Sep 28, 2011 7:15 am
by Brouwer2
Thanks. I'll post there. Sorry for the mixup.

Re: Fn+F12 hotkey not working in KDE 4.6.0

Posted: Wed Sep 28, 2011 10:22 am
by Mike42
I didn’t even know that there is allready a setting for Hibernate/Suspend shortcuts. Thus I created my own Global Shortcut (Command/URL) which runs the following command:

Code: Select all

qdbus org.freedesktop.PowerManagement /org/freedesktop/PowerManagement Hibernate

Re: Fn+F12 hotkey not working in KDE 4.6.0

Posted: Thu Sep 29, 2011 10:30 pm
by Brouwer2
Cheers, that works nicely!

But, I'm intrigued as to why these shortcuts, the ones for the KDE Daemon, do not get saved. After playing around a little I've found out why Fn+F12 is not recognised. Like the xev output above says the Fn+F12 key is called Suspend, however in the file .kde4/share/config/kglobalshortcutsrc the relevant entry looks like this:

Code: Select all

kded]

Hibernate=Hibernate,Hibernate,Hibernate

The problem seems to be that the shortcut for Hibernation needs to be called `Suspend' rather than 'Hibernate'. Sure enough, if you change the shortcut for Hibernate in System Settings -> Global Keyboard Shortcuts by entering Fn+F12, the line in kglobalshorcutsrc becomes

Code: Select all

kded]

Hibernate=Suspend,Hibernate,Hibernate



and pressing Fn+F12 puts the computer into hibernation. The thing I do not understand is why the change is not preserved across sessions. Log back in and kglobalshortcutsrc goes back to its original state. I've tried editing as root from console outside the KDE session. I even tried deleting the file. When I log back in the file is still there in its original state.

Does anyone have any suggestions as to what might be the problem?

Re: Fn+F12 hotkey not working in KDE 4.6.0

Posted: Sat Oct 01, 2011 4:20 am
by GomJabbar
One possible solution...

See what the following displays:

Code: Select all

$ xmodmap -pke
If you see an entry with something like keycode 240 = XF86Suspend, notice what the keycode is for it. Then add an entry in /home/~/.Xmodmap. Create .Xmodmap in kwrite if you need to.

Code: Select all

keycode 240 = F30
Log out /log in or Reboot.

Now try setting F30 as your keyboard shortcut for Hibernate.