3

I'm running 16.04 on an HP laptop. In 14.04, the prntscrn button worked as intended (pressing it took a screenshot of the whole screen, pressing shift + prntscrn took a partial screenshot of a selected area, etc.). Ever since upgrading to 16.04, I can't get it to work at all.

All of the shortcuts are set correctly and everything.

gnome-screenshot is installed, and works if I type it into the terminal.

xev shows this for press + release of the prntscrn button:

KeyPress event, serial 37, synthetic NO, window 0x4400001,
    root 0x2c2, subw 0x0, time 5325568, (-443,285), root:(346,337),
    state 0x10, keycode 218 (keysym 0xff61, Print), same_screen YES,
    XKeysymToKeycode returns keycode: 107
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 37, synthetic NO, window 0x4400001,
    root 0x2c2, subw 0x0, time 5325759, (-443,285), root:(346,337),
    state 0x10, keycode 218 (keysym 0xff61, Print), same_screen YES,
    XKeysymToKeycode returns keycode: 107
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

For comparison, it shows this for the press + release of the F12 button (which works well):

KeyPress event, serial 37, synthetic NO, window 0x4600001,
    root 0x2c2, subw 0x0, time 5433196, (-509,256), root:(280,308),
    state 0x10, keycode 96 (keysym 0xffc9, F12), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 37, synthetic NO, window 0x4600001,
    root 0x2c2, subw 0x0, time 5433406, (-509,256), root:(280,308),
    state 0x10, keycode 96 (keysym 0xffc9, F12), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False
1

I found a solution here:

As I noticed from xev output pressing prt sc on HP Pavilion returns two different codes: 218(the key's code itself) and XKeysymToKeycode returns 107.

I looked at key mapping with xmodmap -pke and noticed that there's binding 107 to Print action but there's no binding for 218 keycode. So I just add binding for keycode 218:

xmodmap -e "keycode 218 = Print"

and then removed binding from 107 keycode

xmodmap -e "keycode 107 = "

After that everything have started working just fine. Hope I helped someone.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.