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

Fun (or not) with global shortcuts

Tags: None
(comma "," separated)
sts
Registered Member
Posts
2
Karma
0

Fun (or not) with global shortcuts

Tue Sep 22, 2009 7:52 pm
Hi there,

I'm relatively new to KDE programming and got into sort of a problem. One of my (fullscreen) applications should disable the global shortcut for window switching - Alt+Tab. But being a nice application it should reset the shortcut to its default behavior when it is exited. What is the best way to do this?

Browsing through the API i stumbled upon KGlobalAccel::stealShortcutSystemwide which allows me to remove the shortcut, but I haven't found a way to get it back ;-) Or maybe that is the wrong way to do it.

Help would be really appreciated

Cheers

Steffen
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
I would recommend shipping a rule that makes KWin enable the "disable global shortcuts" window specific rule for your window type.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
sts
Registered Member
Posts
2
Karma
0
Thanks for the hint, I tried it "manually" and it does indeed work great. But how would I "ship" the rule with my application, i.e. not require the user to do it manually the first time the app starts? Is it possible to set the rule via DBUS? Change some config file? Can my app do this programmatically?
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
You would need to ask the KWin people about this on their mailing list, kwin@kde.org. They may also know other methods to achieve what you are after. It is more than likely just copying the file you generated and installing it when your application is installed.


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


Bookmarks



Who is online

Registered users: Bing [Bot], daret, Google [Bot], sandyvee, Sogou [Bot]