Bug 166608

Summary: PrintScreen button should open KSnapshot (it does in KDE 4.0.4 but not in 4.1)
Product: [Plasma] khotkeys Reporter: Michal Borek <michal>
Component: generalAssignee: Michael Jansen <kde>
Status: RESOLVED FIXED    
Severity: normal CC: adreeve, cardiozibi, cyberbeat, diego.ml, dsent.zen, emmanuel.touzery, esigra, geoff.cutter, iamstanislav, karaluh, kde-2011.08, kde, l.lunak, mutlu_inek, nforce25, null, registration, rolfpedersen, seajey.serg, spammail01, stevenvollom, toddrme2178, walch.martin, xenoterracide, zoom_re
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Michal Borek 2008-07-15 11:43:35 UTC
Version:           nieznana (using 4.00.85 (KDE 4.0.85 (KDE 4.1 >= 20080703) "release 4.2", KDE:KDE4:Factory:Desktop / openSUSE_11.0)
Compiler:          gcc
OS:                Linux (i686) release 2.6.25.9-0.2-pae

In previous version of KDE4 there was very useful shortcut (PtrScr), which was opening KSnapshot. It doesn't work in KDE 4.0.85. 

It's very hard to find settings, where I could change this option.
Comment 1 Christophe Marin 2008-08-11 10:38:59 UTC
*** Bug 168894 has been marked as a duplicate of this bug. ***
Comment 2 Wolfgang Seebacher 2008-08-14 09:48:21 UTC
Confirmed!
Comment 3 Glen Stewart 2008-09-10 01:44:39 UTC
confirmed on Kubuntu Hardy Heron with KDE 4.1.1
Comment 4 Krisztián Kádár-Németh 2008-10-16 17:51:36 UTC
Confirmed on Mandriva 2009.0, KDE 4.1.2. :)
Comment 5 Krisztián Kádár-Németh 2008-10-16 17:53:02 UTC
*** This bug has been confirmed by popular vote. ***
Comment 6 Tommi Tervo 2008-11-05 19:37:29 UTC
*** Bug 174264 has been marked as a duplicate of this bug. ***
Comment 7 Caleb Cushing 2008-11-12 12:51:31 UTC
confirmed gentoo 4.1.3

actually it doesn't appear that any of the hotkeys in khotkeys or kwin work for me.

I also seem to have duplicate entries in khotkeys for printscreen although only one of them has the shortcut assigned.

also this shouldn't be wishlist as it's a broken feature

Comment 8 Caleb Cushing 2008-11-12 12:55:12 UTC
correction... kwin hotkeys work, except for the printscreen ones.

but khotkeys like ctrl+alt+t to bring up konsole don't
Comment 9 Caleb Cushing 2008-11-12 13:12:00 UTC
I deleted the following 

.kde4.1/share/config/khotkeysrc
.kde4.1/share/config/kglobalshortcutsrc

I think you have to be logged out of your X account when deleting them.

then ran khotkeys when I logged back in and it seems to be working now

However. khotkeys doesn't seem to have started on it's own, which could be part of the problem. (or even most peoples problem)
Comment 10 Glen Stewart 2008-11-13 00:25:08 UTC
None of the suggested workarounds solve my problem to date.
Comment 11 Rolf Pedersen 2008-12-15 00:37:03 UTC
(In reply to comment #9)
> I deleted the following 
> 
> .kde4.1/share/config/khotkeysrc
> .kde4.1/share/config/kglobalshortcutsrc
> 
> I think you have to be logged out of your X account when deleting them.
> 
> then ran khotkeys when I logged back in and it seems to be working now
> 
> However. khotkeys doesn't seem to have started on it's own, which could be part
> of the problem. (or even most peoples problem)
> 

Running Mandriva 2009, KDE 4.1.3, I found this bug by searching google, as the PrintScreen key does not work for me as it did in KDE 3.5, either.  I voted and tried Caleb's workaround, which seems to get the key working as it should, after starting khotkeys, as he said.  Additionally, adding khotkeys as a program in the Autostart module of SystemSettings has provided a working PrintScreen behavior, past one reboot, anyway.
Comment 12 NForce 2008-12-15 00:59:33 UTC
In 4.1.80, 4.1.81, 4.1.85 this bug is not present anymore
Comment 13 Glen Stewart 2008-12-15 01:38:23 UTC
(In reply to comment #12)
> In 4.1.80, 4.1.81, 4.1.85 this bug is not present anymore
> 

I can confirm that - running KDE 4.1.80, if I unassign the Global Keyboard Shortcut for PrintScreen, and then go into Input Actions and assign PrintScreen to the Ksnapshot application, it works.

This is in Kubuntu Intrepid.
Comment 14 Diego 2008-12-23 18:10:27 UTC
Doesn't work out of the box in Fedora 10 with 4.2 beta 2 from kde-testing. This should work without user intervention.
Comment 15 zOOm_ER 2009-01-12 17:53:23 UTC
confirmed on KDE 4.2 beta 2 (opensuse-live)
printscreen still doesn't do anything.
Comment 16 Todd 2009-01-28 18:23:36 UTC
Still not working in KDE 4.2 final.
Comment 17 Sergei Andreev 2009-01-29 09:12:58 UTC
AFAIR in kubuntu 8.10 with KDE 4.2rc1 PrintScreen worked "from the box".
Comment 18 Dotan Cohen 2009-01-30 02:57:31 UTC
In Kubuntu 8.10 with the official KDE 4.2 it doesn't work. Of course Glen Stewart's suggestion would probably work, but this should work without user intervention.
Comment 19 Caleb Cushing 2009-01-31 07:28:33 UTC
not only can I confirm in gentoo/regen2 in 4.2 but my workaround doesn't work as khotkeys binary no longer exists. anyone have a working workaround?
Comment 20 Luigi Toscano 2009-02-04 23:23:11 UTC
*** Bug 181072 has been marked as a duplicate of this bug. ***
Comment 21 Caleb Cushing 2009-03-06 00:36:03 UTC
yah know... I just noticed this is assigned to the wrong people. it's not a problem with ksnapshot, that works fine, it's a problem with khotkeys not listening/calling ksnapshot. can someone change the product?

still present in 4.2.1
Comment 22 Danila Sentiabov 2009-03-15 19:53:29 UTC
Hotkeys are working as root in 4.2.1/openSUSE 11.1, but not working as regular user.
Comment 23 Caleb Cushing 2009-03-25 05:00:09 UTC
I just noticed this is wishlist. can we move this to bug? and maybe get it blocking the release of kde 4.3... it's obviously not isolated.
Comment 24 Diego 2009-03-25 10:10:33 UTC
I remember Chani blogged about plans for keyboard shortcuts for KDE 4.3 in this blog post:
http://chani.wordpress.com/2009/01/29/jamaica/

CCing her, maybe she can help.
And sorry to her for the disturb if she can't help.
Comment 25 Rolf Pedersen 2009-03-25 13:59:04 UTC
(In reply to comment #11)
> (In reply to comment #9)
> > I deleted the following 
> > 
> > .kde4.1/share/config/khotkeysrc
> > .kde4.1/share/config/kglobalshortcutsrc
> > 
> > I think you have to be logged out of your X account when deleting them.
> > 
> > then ran khotkeys when I logged back in and it seems to be working now
> > 
> > However. khotkeys doesn't seem to have started on it's own, which could be part
> > of the problem. (or even most peoples problem)
> > 
> 
> Running Mandriva 2009, KDE 4.1.3, I found this bug by searching google, as the
> PrintScreen key does not work for me as it did in KDE 3.5, either.  I voted and
> tried Caleb's workaround, which seems to get the key working as it should,
> after starting khotkeys, as he said.  Additionally, adding khotkeys as a
> program in the Autostart module of SystemSettings has provided a working
> PrintScreen behavior, past one reboot, anyway.

In Mandriva 2009.1 RC1, the printscreen key is working to start ksnapshot since installation.    

ksnapshot-4.2.1-2mdv2009.1
kdebase4-workspace-4.2.1-126mdv2009.1

I don't see khotkeys running in ps:

[rolf@localhost ~]$ ps aux|grep hot
rolf      5758  5.1  1.3  42600 28956 ?        R    05:35   0:01 /usr/bin/perl /usr/bin/draksnapshot-applet

In fact, it's not installed:

[rolf@localhost ~]$ urpmf khotkey
[..]
kdebase3-progs:/opt/kde3/bin/khotkeys
[..]
[rolf@localhost ~]$ rpm -q kdebase3-progs
package kdebase3-progs is not installed
Comment 26 Chani 2009-03-25 20:32:33 UTC
nothing to do with me.
Comment 27 Dotan Cohen 2009-03-26 21:40:10 UTC
I can comment that in Kubuntu 9.04 alphas with KDE 4.2 the Print Screen button does open Ksnapshot properly. I do not know if this is a Kubuntu or KDE change, though.
Comment 28 Caleb Cushing 2009-03-26 21:44:16 UTC
are the alpha's on 4.2.1? or an svn version?
Comment 29 Unknown 2009-03-26 23:23:56 UTC
It doesn't work for me in Kubuntu Jaunty 9.04 Alpha 6 with KDE 4.2.1 (PrintScreen button doesn't open KSnapShot) !!

My laptop key combination (Fn + PrtScrn) is recognized in the Global Shortcuts, khotkeys !

KDE Service manager says that KHotKeys service is running, but I don't see in the ps list if I do 'ps aux | grep -i khot'. Not sure if this is the correct way of checking running service.
Comment 30 Dotan Cohen 2009-03-27 14:21:22 UTC
1) It seems that the Kubuntu Jaunty alphas use KDE 4.2.1

2) KHotKeys does not have to be running for the shortcut to work in the Kubuntu Jaunty alphas.
Comment 31 Caleb Cushing 2009-03-27 14:42:58 UTC
I've had people using the same distro  as me say it works... but it doesn't for me, and hasn't on fresh installs. I'm clueless as to what could be different.
Comment 32 FiNeX 2009-04-12 14:17:59 UTC
*** Bug 189448 has been marked as a duplicate of this bug. ***
Comment 33 Steven Vollom 2009-04-14 03:57:48 UTC
KDE 4.2.2 Print Screen does not work.  64bit AMD Quad Jaunty Beta.  It would be nice to have it back.  Thanks!
Comment 34 Dotan Cohen 2009-04-24 15:19:35 UTC
I can confirm Steven Vollom's observation. Although KDE 4.2.0 and I think 4.2.1 did in fact have a functional Print Screen button, KDE 4.2.2 does not.
Comment 35 Geoff Cutter 2009-05-01 14:30:37 UTC
KSnapshot works from the Print Screen button for me.

Qt: 4.4.3
KDE: 4.2.2 (KDE 4.2.2) "release 112"
KSnapshot: 0.8.1

openSUSE 11.1 (i586)

Linux 2.6.27.21-0.1-pae i686
Comment 36 Caleb Cushing 2009-05-01 15:00:30 UTC
kinda tired of worksforme... I install a brand new clean system and it doesn't work for me.
Comment 37 Danila Sentiabov 2009-05-01 15:02:17 UTC
So it's probably a Qt 4.5 issue.
Will it be fixed in 4.2.3?
Comment 38 Caleb Cushing 2009-05-07 08:59:05 UTC
exists out of the box in arch linux 4.2, and I don't see how it's a qt-4.5 issue, I've had this since forever. it was 4.1 (which had a workaround), 4.2.0, none switched to 4.5 until  4.2.1
Comment 39 stanislav 2009-05-07 18:07:18 UTC
KDE 4.2.71 / Qt 4.5
Arch Linux x86_64
--------------------

Not working PrtScr (for Ksnapshot), Ctrl+`, Ctrl+Alt+.
Comment 40 Adam 2009-06-15 23:45:39 UTC
Same problem here on Kubuntu 9.10 beta, KDE 4.3. Print screen key does nothing.
Comment 41 zOOm_ER 2009-06-17 14:05:16 UTC
To make this work on KDE 4.3 (i use beta2, but it might work on other versions):
1) Go to System Settings -> Input Actions.
2) Right-click on the field (actions list) on the left of the window (the one with example actions)
3) Select in dropped-down menu New -> Global Shortcut -> Command\URL
4) Type a new name to this Action (i named it "PrintScreen")
5) Be shire this Action is selected in the list, and go to the right side of the window, to "Trigger" tab.
6) Assign shortcut to this action (PrtScr, or any key sequence you want)
7) Go to the Action tab, and type "ksnapshot" in Command\URL field.
8) Apply, and profit.
Comment 42 Lubos Lunak 2009-07-29 17:39:44 UTC
This is caused by r933942 "Import actions always in disabled state." - that is not right. The PrintScreen action is imported from printscreen.khotkeys and should be enabled by default, but this makes it disabled (and just enabling it in the kcm makes it all work).
I don't see the purpose of the change - if something should not be enabled when imported, it should be already disabled in the .khotkeys file.
Comment 43 Zbyszek 2009-08-16 23:48:54 UTC
I can confirm that PrtSc shortcut doesn't work out-of-the-box in KDE 4.3.0 (Arch Linux x86_64), neither reassigning the shortcut seem to be working.
Comment 44 Neil Skrypuch 2009-08-17 02:17:12 UTC
Seems to be working for me out of the box in KDE 4.3.0 (Gentoo). It wasn't in 4.2 or 4.1 though.
Comment 45 Dotan Cohen 2009-08-17 10:13:27 UTC
Kubuntu 9.04 KDE 4.3: Printscreen button does not work out of the box.
Comment 46 Michael Jansen 2009-08-17 10:39:22 UTC
To stop the flood of works/works not emails. It shouldn't work in kde 4.3 for new user accounts. It should work or not for user accounts setup with previsous kde version. The reason is pointed out Lubos in comment #42.

I'm fixing that for 4.4. The problem as usual in this cases is that only new user accounts will profit from the solution. Everyone having created it's user account before or after 4.2 should have a not working key. Everyone doing that exactly with 4.2 should have it working.
Comment 47 Dotan Cohen 2009-08-17 11:41:52 UTC
Thank you Michael. For those of use who switched to KDE after r933942, how do we fix the problem. From Lubos' comment it looks like we must enable something called kcm. How do we do that?

Thanks.
Comment 48 Caleb Cushing 2009-08-17 18:18:34 UTC
@Michael where definition of new user account means no .kde* directory? or maybe there will just be some file in .kde people can easily delete to reset it?
Comment 49 Michael Jansen 2009-08-20 21:12:06 UTC
It should be sufficient to delete the file .kde/share/config/khotkeysrc. Do that only if you never used khotkeys. Should only work in kde 4.2.

You have to relogin to recreate the file with the default content.

"kcmshell4 khotkeys" will open the kcm that is doing the work. kmenuedit could be used to assign an shortcut to the application ksnapshot.

For kde 4 i try to fix all wishes about kde not responding to "multimedia key xyz". At least those supported by qt. the groundwork is done.
Comment 50 H.H. 2009-08-20 21:27:43 UTC
"It should be sufficient to delete the file .kde/share/config/khotkeysrc. Do
that only if you never used khotkeys. Should only work in kde 4.2."

Do you mean that workaround does not work for kde-4.3? Is there a workaround for kde-4.3?
Comment 51 Dotan Cohen 2009-08-23 13:05:02 UTC
I can confirm that erasing .kde/share/config/khotkeysrc in KDE 4.3 on a user that started out as KDE 4.2 does not enable the PrintScreen button. It only makes the currently configured shortcuts go away.
Comment 52 Emmanuel Touzery 2009-09-23 19:49:48 UTC
KDE 4.3.1, the print screen key didn't work after setting up KDE, I deleted the .kde/share/config/khotkeysrc (whiled logged out, and relogged in afterwards) and it still doesn't work, even if I focus the desktop.
Comment 53 Emmanuel Touzery 2009-09-24 19:32:27 UTC
here's what I found about making screenshots in KDE using the print screen button.

It is configurable in System Settings->Keyboard & Mouse->Global Keyboard Shortcuts.

There on the combo on the top pick
KDE component: KWin.

By default there are two shortcuts:
Window Screenshot to Clipboard: Alt+Print
Desktop Screenshot to Clipboard: Control+Print (there I would have expected simply Print)

Now if I copy an image to the clipboard with gimp then press control+print, then paste with gimp, gimp tries to paste something (so the control+print did something) but in the end fails and says that there's no picture in the clipboard.

If I copy from gimp then press alt+printscreen then gimp pastes the image it copied so it seems alt+print screen is not detected (no action is taken when alt+printscreen is pressed).
Same with printscreen alone, no action taken.

If I try to reassign a keyboard shortcut to control+print it works (what I type on the keyboard is correctly detected as control+print).
If I try to reassign a keyboard shortcut to alt+print it says that keyboard combination is not supported by Qt (this is a bog-standard desktop keyboard, not laptop keyboard, no multimedia keys).
If I try to reassign a keyboard shortcut to print it works.

Also during this testing I managed to loose the keyboard. It just stopped reacting to key presses. I had to log out and back in. It worked the whole time in text ttys and when I logged out it worked immediately in KDM.
Comment 54 Maciej Warnecki 2009-09-24 19:35:59 UTC
PrintScreen works for me OOTB. Didn't try any "black magic" KDE 4.3.1, Arch
Kdemod (Chakra)
Comment 55 Emmanuel Touzery 2009-09-24 19:43:58 UTC
I'm using kubuntu karmic if that helps (not stable yet).
Comment 56 Lubos Lunak 2009-09-30 18:37:21 UTC
SVN commit 1029742 by lunakl:

Do not force disabling of imported actions. Some, such as PrintScreen
handling, should be enabled by default.
BUG: 166608



 M  +1 -1      settings.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1029742
Comment 57 Lubos Lunak 2009-09-30 18:38:08 UTC
SVN commit 1029743 by lunakl:

Backport r1029742.
Do not force disabling of imported actions. Some, such as PrintScreen
handling, should be enabled by default.
BUG: 166608



 M  +2 -2      settings.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1029743
Comment 58 esigra 2009-11-05 13:44:09 UTC
Had this problem after Gentoo forced me to move from KDE 3.5.10 to KDE 4.3.1. Tried to start khotkeys and then it worked! But I found out that program was a leftover from KDE3, so it would soon go away. Tried zOOm_ER's method instead, but it did not work at first. But with an additional step, it finally worked.

(In reply to comment #41)
> To make this work on KDE 4.3 (i use beta2, but it might work on other
> versions):
> 1) Go to System Settings -> Input Actions.
> 2) Right-click on the field (actions list) on the left of the window (the one
> with example actions)
> 3) Select in dropped-down menu New -> Global Shortcut -> Command\URL
> 4) Type a new name to this Action (i named it "PrintScreen")
> 5) Be shire this Action is selected in the list, and go to the right side of
> the window, to "Trigger" tab.
> 6) Assign shortcut to this action (PrtScr, or any key sequence you want)
> 7) Go to the Action tab, and type "ksnapshot" in Command\URL field.

7a) Make sure that the checkbox after "Examples" is checked. Otherwise "Examples" is grayed out and nothig below it in the tree structure will work.

> 8) Apply, and profit.
Comment 59 Dotan Cohen 2009-12-18 14:05:47 UTC
Works for me in KDE 4.3.4 without playing with any files. Thanks!
Comment 60 Caleb Cushing 2010-02-11 20:03:32 UTC
I'm not sure on 4.3.4 or 4.3.5 but it's fixed out of the box in 4.4 I'm happy.
Comment 61 karaluh 2010-02-12 08:25:59 UTC
How to enable the previously disabled imported actions in 4.4.0?
Comment 62 Caleb Cushing 2010-08-13 03:47:24 UTC
I just installed 4.5.0 and am pressing printscreen.... nothing happens
Comment 63 Caleb Cushing 2010-08-13 04:12:34 UTC
I should note that I rm -rf ~/.kde4 before install 4.5.0 and the only settings I imported thus far have been konversation and ktorrent
Comment 64 mutlu inek 2010-08-16 16:05:04 UTC
It works for me (I am also on KDE 4.5.0). I started with a new ~/.kde4 directory when I moved to the first 4.5 beta. I do not recall having added the shortcut, but I may be wrong.

I found the entry "Print Screen" > "Print" in System Settings --> Global Keyboard Shortcuts --> KDE component: khotkeys

Caleb, what setting is there for you? And does anyone know which config file might I want to remove and restart KDE to reset this specific setting? I want to make sure I did not add this myself.
Comment 65 Caleb Cushing 2010-08-17 00:48:33 UTC
I have a 'printscreen' entry... (actually 3) but I'm pretty sure I added all 3 myself in custom trying to get it work. I also deleted them in custom but it still show's 3 of them. no 'Print Screen' Entry. Even if I added it... unless I did something wrong adding a custom keyboard shortcut it wouldn't work.
Comment 66 karaluh 2010-08-17 08:03:21 UTC
(In reply to comment #65)
> I have a 'printscreen' entry... (actually 3) but I'm pretty sure I added all 3
> myself in custom trying to get it work. I also deleted them in custom but it
> still show's 3 of them. no 'Print Screen' Entry. Even if I added it... unless I
> did something wrong adding a custom keyboard shortcut it wouldn't work.

I also don't have anything "Print Screen" related in khotkeys component.
Comment 67 Martin Walch 2011-01-09 23:14:11 UTC
Finally, it is working again now with KDE 4.5.5 and after removing some files in ~/.kde4/share/config. :)
Comment 68 karaluh 2012-11-07 10:23:59 UTC
I still don't have working Print Screen key. Can anyone tell me how to fix it?
Comment 69 Rolf Pedersen 2012-11-08 14:27:04 UTC
(In reply to comment #68)
> I still don't have working Print Screen key. Can anyone tell me how to fix
> it?

It has been working without further intervention from me since I last posted to this bug.  Currently, in KDE Version 4.6.5, I have the following configuration:

Systemsettings (Configure Your Desktop) > Common Appearance and Behavior > Shortcuts and Gestures > Global Keyboard Shortcuts > KDE component: khotkeys (from drop-down menu) > PrintScreen

I can click on PrintScreen and it expands to Default: None and Custom: options.  I can select Custom, click on the adjacent button, which shows the default, none, and get prompted for "Input ..."

Here, I press the PrintScreen/SysRq button and that becomes the khotkey shortcut for ksnapshot.  hth.
Comment 70 karaluh 2012-11-08 14:40:22 UTC
(In reply to comment #69)
> (In reply to comment #68)
> > I still don't have working Print Screen key. Can anyone tell me how to fix
> > it?
> Here, I press the PrintScreen/SysRq button and that becomes the khotkey
> shortcut for ksnapshot.  hth.

Yes, it did help. I had to remove a conflict with kmenuedit as an additional step.