Bug 477041 - registerShortcut() is not registering many shortcuts
Summary: registerShortcut() is not registering many shortcuts
Status: REPORTED
Alias: None
Product: kwin
Classification: Plasma
Component: scripting (show other bugs)
Version: 5.27.9
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-15 12:29 UTC by Nico Dorn
Modified: 2024-03-03 15:19 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nico Dorn 2023-11-15 12:29:44 UTC
Nearly no shortcut is working with registerShortcut(). There are some, though, but it seems that every letter shortcut is rejected. Among the ones I tested are "Meta+I", "Meta+Ctrl+I", "Meta+N", "Meta+B", "Ctrl+Alt+B" … I made sure to test shortcuts that were not registered yet.

But some shortcuts do work, for example "Meta+F4" or "Meta+Num+8" (if NumPad is enabled). A working example:

  print("started");
  registerShortcut("Test", "Test", "Meta+F4", () => print("works"));

"started" is always printed to the journal, "works" only after a shortcut that was really registered (like "Meta+F4") is triggered. There is never any error message in the journal.

SOFTWARE/OS VERSIONS
Operating System: KDE neon 5.27
KDE Plasma Version: 5.27.9
KDE Frameworks Version: 5.111.0
Qt Version: 5.15.11
Kernel Version: 6.2.0-36-generic (64-bit)
Graphics Platform: X11
Processors: 16 × Intel® Core™ i7-10875H CPU @ 2.30GHz
Memory: 62.5 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics
Manufacturer: TUXEDO
Product Name: TUXEDO Book XC1711
System Version: Not Applicable
Comment 1 Nico Dorn 2023-11-15 14:16:03 UTC
I got it up and running, but honestly, I don't know how. Mayby the shortcuts list was all messed up due to all my testing and this did the trick:

    qdbus org.kde.kglobalaccel /component/kwin org.kde.kglobalaccel.Component.cleanUp

That might be it, as uninstalling or updating a script via UI (System Settings > Window Management > KWin Scripts) does not expunge the shortcuts list in ~/.config/kglobalshortcutsrc. But that doesn't explain why it didn't work in the first place. Hm, weird…