This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Is possible to invoke a standard keyboard shortcut via DBus?

Tags: None
(comma "," separated)
ChapaikinVA
Registered Member
Posts
14
Karma
0
OS
"An action, which can be assigned to standard shortcut" - I mean an action, which can be found in the list in:
System Settings > Shortcuts and Gestures > Standard Keyboard Shortcuts.

E.g. (such actions): About Application, Copy, Cut, Paste, Undo, Redo and so on.

Q: Is possible to invoke a standard keyboard shortcut (or an attached action) via D-Bus command? If it is possible, how to do this?

It is possible to invoke a global keyboard shortcut.
E.g., the following command invokes a global shortcut "Maximize Window" of KWin component:
Code: Select all
qdbus org.kde.kglobalaccel /component/kwin org.kde.kglobalaccel.Component.invokeShortcut "Window Maximize"
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
To the best of my knowledge this is not immediately possible. However what you could do instead of issuing the command via D-Bus is "simulate" the keypress which should trigger the shortcut if you are focused in the correct application.

xte can be used for these purposes.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]


Bookmarks



Who is online

Registered users: bancha, Bing [Bot], Evergrowing, Google [Bot], lockheed, mesutakcan, Sogou [Bot]