KGlobalAccel Class Reference
from PyKDE4.kdeui import *
Inherits: QObject
Detailed Description
Configurable global shortcut support
KGlobalAccel allows you to have global accelerators that are independent of the focused window. Unlike regular shortcuts, the application's window does not need focus for them to be activated.
- See also:
- KKeyChooser
- See also:
- KKeyDialog
Methods | |
__init__ (self) | |
[QStringList] | allActionsForComponent (self, QStringList actionId) |
[QStringList] | allMainComponents (self) |
bool | isEnabled (self) |
overrideMainComponentData (self, KComponentData componentData) | |
setEnabled (self, bool enabled) | |
Static Methods | |
QStringList | findActionNameSystemwide (QKeySequence seq) |
bool | promptStealShortcutSystemwide (QWidget parent, QStringList actionIdentifier, QKeySequence seq) |
KGlobalAccel | self () |
stealShortcutSystemwide (QKeySequence seq) |
Method Documentation
__init__ | ( | self ) |
Creates a new KGlobalAccel object
[QStringList] allActionsForComponent | ( | self, | ||
QStringList | actionId | |||
) |
Return the full actionIds of all actions with global shortcuts for the main component specified by actionId. Only the the ComponentUnique part of actionId will be used; the other members of the actionId QStringList will be ignored.
[QStringList] allMainComponents | ( | self ) |
Return the unique and common names of all main components that have global shortcuts. The action strings of the returned actionId stringlists will be empty.
QStringList findActionNameSystemwide | ( | QKeySequence | seq | |
) |
Return the name of the action that uses the given key sequence. This applies to all actions with global shortcuts in any KDE application.
- See also:
- promptStealShortcutSystemwide(), stealShorctutSystemwide()
bool isEnabled | ( | self ) |
Checks whether the accelerators are enabled.
- Returns:
- true if the KGlobalAccel is enabled
overrideMainComponentData | ( | self, | ||
KComponentData | componentData | |||
) |
Set the KComponentData for which to manipulate shortcuts. This is for exceptional situations, when you want to modify the shortcuts of another application as if they were yours. You cannot have your own working global shortcuts in a module/application using this special functionality. All global shortcuts of KActions will essentially be proxies. Be sure to set the default global shortcuts of the proxy KActions to the same as those on the receiving end. An example use case is the KControl Module for the window manager KWin, which has no own facility for users to change its global shortcuts.
- Parameters:
-
componentData a KComponentData about the application for which you want to manipulate shortcuts.
bool promptStealShortcutSystemwide | ( | QWidget | parent, | |
QStringList | actionIdentifier, | |||
QKeySequence | seq | |||
) |
Show a messagebox to inform the user that a global shorcut is already occupied, and ask to take it away from its current action. This is GUI only, so nothing will be actually changed.
- See also:
- stealShorctutSystemwide()
KGlobalAccel self | ( | ) |
Returns (and creates if necessary) the singleton instance
setEnabled | ( | self, | ||
bool | enabled | |||
) |
Enables or disables the KGlobalAccel
- Parameters:
-
enabled true if the KGlobalAccel should be enabled, false if it should be disabled.
stealShortcutSystemwide | ( | QKeySequence | seq | |
) |
Take away the given shortcut from the named action it belongs to. This applies to all actions with global shortcuts in any KDE application.
- See also:
- promptStealShortcutSystemwide()