Results 1 to 2 of 2

Thread: Screenshot Hotkeys Not Working

  1. #1
    Join Date
    Feb 2011
    Beans
    411

    Screenshot Hotkeys Not Working

    After installing Ubuntu 14.04 I noticed my printscreen hotkeys for taking screenshots no longer work, after some research turned up these 2 links http://askubuntu.com/questions/45007...m-13-10-to-14# and https://bugs.launchpad.net/ubuntu/+s...e/+bug/1243733 putting the info from these two together it seems its a bug with HP keyboards assigning print to two separate keycodes at the end of the launchpad link it gives the commands...

    Code:
    david@HP-G6:~$ xmodmap -pk | grep Print    107        0xff61 (Print)    0xff15 (Sys_Req)    0xff61 (Print)    0xff15 (Sys_Req)    
        218        0xff61 (Print)    0x0000 (NoSymbol)    0xff61 (Print)
    Code:
    xmodmap -e "keycode 107 = Sys_Req "
    Code:
    david@HP-G6:~$ xmodmap -pk | grep Print    218        0xff61 (Print)    0x0000 (NoSymbol)    0xff61 (Print)
    Which shows the two keys mapped to print then the second command changes it. After executing these commands I can set the screenshot shortcuts using the keyboard GUI and everything works as designed till I have to reboot then the whole process must be repeated, kind of a pain.

    So is there a way to make the the...
    Code:
    xmodmap -e "keycode 107 = Sys_Req "
    permanent so my keyboard works normally all the time, even through reboots or is there a CLI way to set the keyboard shortcuts for screenshots, so I can write a basic bash startup script to automate this process upon login?

    I've looked through dconf-editor to look for a key to set with gsettings but the closest I came up with was org>compiz>integrated>command-screenshot>gnome-screenshot but nothing seemingly related to setting hotkeys to activate it. Hoping someone else will have some insight on a better way to fix this issue.
    What I'm dealin' with:
    HP Pavilion G6-1D60US, dual booted: Ubuntu 16.04 64bit, & Windows 7 Home Premium 64bit, 640 gig HDD, 4 gig RAM

  2. #2
    Join Date
    Feb 2011
    Beans
    411

    Re: Screenshot Hotkeys Not Working

    So after hours of searching I found a fix for my particular case, which is basically to edit file /usr/share/X11/xkb/keycodes/evdev, a file xkb uses to build keycodes for keyboards and places the files in /var/lib/xkb as a file, or in my case files, named server-[randomstring].xkm. The edit to evdev that needs to be made, is on line 93 and 94 changing this...

    Code:
        <PRSC> = 107;
        //<SYRQ> = 107;
    to this...

    Code:
        //<PRSC> = 107;
        <SYRQ> = 107;
    this comments out Print assignment to 107 and changes it to Sys_Req, for good measure I got rid of the old files in /var/lib/xkb which will be regenerated correctly upon reboot. Also after reboot I had to go into the; system settings> keyboard> shortcuts> screenshots GUI, and re-assign the keys to take screenshots. So quick steps...

    Code:
    gksudo gedit /usr/share/X11/xkb/keycodes/evdev
    make the changes listed above and save

    Code:
    sudo rm /var/lib/xkb/server-*.xkm
    reboot and re-assign keys via the GUI, this will hold upon subsequent reboots. These instructions are specific to HP keyboards similar issues with different hardware may require different edits (then again this seems like a bad edit by a programmer that may have slipped through so it may help others).
    What I'm dealin' with:
    HP Pavilion G6-1D60US, dual booted: Ubuntu 16.04 64bit, & Windows 7 Home Premium 64bit, 640 gig HDD, 4 gig RAM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •