PrtScrn Button not working in current

The place to discuss Linux and Unix Operating Systems
Forum rules
Behave
Post Reply
User avatar
mlangdn
Preferred Diner
Posts: 30
Joined: Thu Apr 07, 2022 11:28 pm
Location: Western Kentucky

PrtScrn Button not working in current

Post by mlangdn »

PrtScrn button no longer works in current KDE. I have used it for years and now it is gone. Can't find a solution in Google, and no search has been fruitful. Any ideas?

I just noticed that the Scroll Lock button isn't working either.....All other buttons seem to be working fine. This is an old keyboard - maybe I'd better hook up another and test.
User avatar
Zema Bus
Your Co-Host
Posts: 1115
Joined: Sun Feb 04, 2024 1:25 am

Re: PrtScrn Button not working in current

Post by Zema Bus »

Hi mlangdn, is spectacle installed, and if so is it configured in settings (keyboard/shortcuts)? If it is installed and configured, what happens if you try launching spectacle from a terminal?

Scroll lock isn't something I generally use so I checked mine, I'm in Plasma 5.27 in Slackware right now but scroll lock doesn't work for me either. I also tried it on my other machine running Arch and the MATE desktop, doesn't work there either. I'm guessing there's a setting for this too, I'll see what I can find.

Looks like xmodmap is the way to get that working. Here's a discussion on how to do that. This is for X11 though, in case you're running Wayland.
User avatar
Grogan
Your Host
Posts: 2048
Joined: Sat Aug 21, 2021 10:04 am
Location: Ontario, Canada

Re: PrtScrn Button not working in current

Post by Grogan »

Bear in mind that Scroll Lock would not change any behaviour unless it's in an application that makes use of it. That's a throwback from old DOS days.

For example, if I enable it with xmodmap, I can get it to work in LibreOffice Calc (spreadsheet) because the program supports it, yet it doesn't do anything in my GUI text editors, or vi editor on the console.

For another example, the Insert/Overstrike works in most editors, but also doesn't work everywhere. Also, I don't have anything that intercepts Print Screen in my environment.

P.S. Reading that link, the answers neglect the proper method for making xmodmap changes permanent, the place to put that is to generate an ~/.Xmodmap file and source that, not in a startup script.

After adding it, dump the full key table to .Xmodmap

Code: Select all

xmodmap -e 'add mod3 = Scroll_Lock' 
For a full dump formatted as expressions that xmodmap can use:

Code: Select all

xmodmap -pke
It'll be a long list like this:

Code: Select all

keycode  76 = F10 F10 F10 F10 F10 F10 XF86Switch_VT_10
keycode  77 = Num_Lock NoSymbol Num_Lock
keycode  78 = Scroll_Lock NoSymbol Scroll_Lock
keycode  79 = KP_Home KP_7 KP_Home KP_7
keycode  80 = KP_Up KP_8 KP_Up KP_8
You can see my Scroll_Lock addition as keycode 78

Dump this to an .Xmodmap file like this:

Code: Select all

xmodmap -pke > ~/.Xmodmap
If using startx, this has to be sourced in .xinitrc something like this:

Code: Select all

if [ -f ~/.Xmodmap ]; then
    xmodmap ~/.Xmodmap
fi
If using startx without your own .xinitrc, the default one in /etc/X11/xinit will source this automatically in most distros (certainly Slackware... I remember seeing that)

If using a display manager, it will likely source that file if it exists automatically.
User avatar
mlangdn
Preferred Diner
Posts: 30
Joined: Thu Apr 07, 2022 11:28 pm
Location: Western Kentucky

Re: PrtScrn Button not working in current

Post by mlangdn »

The Spectacle app that KDE uses works through the start menu. I got my screen grab that way. PrtScrn had always worked for years through KDE and Spectacle. I'm wondering if the keyboard has just gone bad. I've been banging on this one for over ten years. Keyboards are not super expensive, so I'll try that first.

Then again, I can just boot a different partition and check.....

But thanks for the write up! You are the most detailed person I know.
User avatar
Grogan
Your Host
Posts: 2048
Joined: Sat Aug 21, 2021 10:04 am
Location: Ontario, Canada

Re: PrtScrn Button not working in current

Post by Grogan »

I think that would likely be KDE's shortcut keys that bind that program to Print Screen. Maybe take a look in your KDE System Settings or whatever they call it now (I still want to call it KDE Control Center) in the keyboard configuration section. There should be a list of their key bindings and what they do, you may be able to change it to open Spectacle if it's bound to something else, or if it's missing, add it or something.
User avatar
Zema Bus
Your Co-Host
Posts: 1115
Joined: Sun Feb 04, 2024 1:25 am

Re: PrtScrn Button not working in current

Post by Zema Bus »

In Plasma 6 this should be under settings/keyboard/shortcuts.
User avatar
mlangdn
Preferred Diner
Posts: 30
Joined: Thu Apr 07, 2022 11:28 pm
Location: Western Kentucky

Re: PrtScrn Button not working in current

Post by mlangdn »

I tried to run spectacle from a terminal and I got:

Code: Select all

spectacle: error while loading shared libraries: libOpenCL.so.1: cannot open shared object file: No such file or directory
That's why the shortcut doesn't work. That's an Nvidia library? Rats.... Got some searching to do. I don't want to go back to the blob...
User avatar
Grogan
Your Host
Posts: 2048
Joined: Sat Aug 21, 2021 10:04 am
Location: Ontario, Canada

Re: PrtScrn Button not working in current

Post by Grogan »

Not necessarily an nvidia library, though possibly one provided by the Nvidia driver. You just need to install the package that has it in Slackware. I should think installing mesa should provide it, but it might be split out nowadays. It may be that you need to reinstall your Mesa package (when you removed Nvidia drivers it could have nuked that library?)

It's because of inherited dependencies, not that your screenshot utility is going to use OpenCL.
User avatar
Grogan
Your Host
Posts: 2048
Joined: Sat Aug 21, 2021 10:04 am
Location: Ontario, Canada

Re: PrtScrn Button not working in current

Post by Grogan »

Got it... you need to install ocl-icd-2.3.2-x86_64-1.txz from the L package series. (well, that's the version in 64 current right now which I assume you're using)

That provides libOpenCL.so.1.0.0 which should get a symlink, libOpenCL.so.1. That could actually be what's wrong, your symlink could have been replaced with a library and now it's gone.

This is a dispatcher library. Mesa provides a back end, libOpenCLMesa.so.whatever
User avatar
mlangdn
Preferred Diner
Posts: 30
Joined: Thu Apr 07, 2022 11:28 pm
Location: Western Kentucky

Re: PrtScrn Button not working in current

Post by mlangdn »

You nailed it G! All is well in the universe once again. I would've been another day or so tracking that.
User avatar
Grogan
Your Host
Posts: 2048
Joined: Sat Aug 21, 2021 10:04 am
Location: Ontario, Canada

Re: PrtScrn Button not working in current

Post by Grogan »

Good... so your Print Screen key now launches the Spectacle program again?
User avatar
mlangdn
Preferred Diner
Posts: 30
Joined: Thu Apr 07, 2022 11:28 pm
Location: Western Kentucky

Re: PrtScrn Button not working in current

Post by mlangdn »

Yep. The key bindings in System-Settings said it was Meta+Print. I found out that Meta is also known as the Windows Key. But it works just using the PrtScrn key. This was the first time I ever looked at key bindings. Probably won't ever have to look again... :)
User avatar
Grogan
Your Host
Posts: 2048
Joined: Sat Aug 21, 2021 10:04 am
Location: Ontario, Canada

Re: PrtScrn Button not working in current

Post by Grogan »

I don't have a Windows key anymore, I'm back to my good old IBM clickety clack keyboard from the 80's (using a PS/2 to USB converter dongle). I just remembered that's actually an important key in Cosmic Desktop used to switch workspaces (Meta+1, 2, 3 etc.) I don't use that anymore, but may again in the near future.

So then, the program itself must be running and usurping the key code for Print Screen, if the binding isn't mapped to it.
Post Reply