4

When I pressed the Print button, nothing happened.

Checked in System Settings, the button is assigned to screenshot.

If I assign ANY other button except Print, it works normally.

Is this a known bug?

HP Pavilion dv6-6051er

EDIT. Exactly as this bug but I'm using Unity not KDE: https://bugs.launchpad.net/ubuntu/+source/kde-workspace/+bug/1243733

Apparently, no keyboard shortcuts work when assigned to the Print button. The button itself is working, as I can assign by pressing it.

2
  • 1
    Going through the linked bug report has a workaround at the end. It boils down to 2 key codes being assigned to (Print), entering: xmodmap -pk | grep Print ,into a terminal window will show this. There is also a command listed in the report to change this, however this varies depending on your machine. After that command is issued the printscreen shortcuts can be re-assigned and should work, the only problem is this key assignment & functionality didn't survive a reboot. Work around script could be made issueing commands to reassign the keys, and the gsettings to assign printscreen.
    – dginsd
    May 17, 2014 at 15:42
  • No need for a script, just a config file, I'm writing the answer.
    – Pavel
    May 21, 2014 at 18:03

1 Answer 1

4

Ok, got it figured out.

The problem appears to be specific to some laptops (such as HP Pavillion dv6-6051er in my case) which use other keycodes for the Print button than the standard 107 which on desktops is both Print and Sys_Req.

Start by xmodmap -pk | grep Print.

In my case, it returned:

107     0xff61 (Print)  0xff15 (Sys_Req)    0xff61 (Print)  0xff15 (Sys_Req)    
218     0xff61 (Print)  0x0000 (NoSymbol)   0xff61 (Print)  

So my Print button was 218 (yours can be different).

What's needed now is to assign Sys_Req to 107 so that Print is only linked with 218.

Execute xmodmap -e "keycode 107 = Sys_Req".

Try to make a screenshot with Print. If fails, go System Settings -> Keyboard -> Shortcuts -> Screenshots and re-assign the Print button to screenshots. Must be ok now.

To save the custom keyboard mapping, in the same session export current settings to an .Xmodmap config file, for example (saves in your home directory):

xmodmap -pke > ~/.Xmodmap

(Or you can just create an .Xmodmap file and only write the required tweak there, for example: keycode 107 = Sys_Req)

A brief xmodmap manual is here: https://wiki.archlinux.org/index.php/xmodmap

The last step. Launch Startup Applications in Dash and add the following command to auto-execute xmodmap on login:

xmodmap /home/YOURUSERNAMEHERE/.Xmodmap

(Make sure you write the full path; you can alternatively auto execute smth like xmodmap -e "keycode 107 = Sys_Req", too)

Over.

PS. using xmodmap in Unity is a bit of a hack as its native keyboard layout manager is xbk but it appears more difficult to tweak and documentation is lacking.

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .