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
Enumerations | |
actionIdFields | { ComponentUnique, ActionUnique, ComponentFriendly, ActionFriendly } |
Methods | |
__init__ (self) | |
[QStringList] | allActionsForComponent (self, QStringList actionId) |
[QStringList] | allMainComponents (self) |
bool | isEnabled (self) |
overrideMainComponentData (self, KComponentData componentData) | |
setEnabled (self, bool enabled) | |
Static Methods | |
activateGlobalShortcutContext (QString contextUnique, QString contextFriendly, KComponentData component=KGlobal.mainComponent()) | |
bool | cleanComponent (QString componentUnique) |
QStringList | findActionNameSystemwide (QKeySequence seq) |
[KGlobalShortcutInfo] | getGlobalShortcutsByKey (QKeySequence seq) |
bool | isComponentActive (QString componentName) |
bool | isGlobalShortcutAvailable (QKeySequence seq, QString component=QString()) |
bool | promptStealShortcutSystemwide (QWidget parent, [KGlobalShortcutInfo] shortcuts, QKeySequence seq) |
bool | promptStealShortcutSystemwide (QWidget parent, QStringList actionIdentifier, QKeySequence seq) |
KGlobalAccel | self () |
stealShortcutSystemwide (QKeySequence seq) |
Method Documentation
__init__ | ( | self ) |
[QStringList] allActionsForComponent | ( | self, | ||
QStringList | actionId | |||
) |
- See also:
- getGlobalShortcutsByComponent
- Deprecated:
[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.
- Deprecated:
bool isEnabled | ( | self ) |
No effect.
- Deprecated:
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.
- Deprecated:
setEnabled | ( | self, | ||
bool | enabled | |||
) |
No effect.
- Deprecated:
Static Method Documentation
activateGlobalShortcutContext | ( | QString | contextUnique, | |
QString | contextFriendly, | |||
KComponentData | component=KGlobal.mainComponent() | |||
) |
Set global shortcut context.
A global shortcut context allows an application to have different sets of global shortcuts and to switch between them. This is used by plasma to switch the active global shortcuts when switching between activities.
- Parameters:
-
component the name of the component. KComponentData.componentName context the name of the context.
- Since:
- 4.2
bool cleanComponent | ( | QString | componentUnique | |
) |
Clean the shortcuts for component componentUnique.
If the component is not active all global shortcut registrations are purged and the component is removed completely.
If the component is active all global shortcut registrations not in use will be purged. If there is no shortcut registration left the component is purged too.
If a purged component or shortcut is activated the next time it will reregister itself. All you probably will lose on wrong usage are the user's set shortcuts.
If you make sure your component is running and all global shortcuts it has are active this function can be used to clean up the registry.
Handle with care!
If the method return true at least one shortcut was purged so handle all previously acquired information with care.
QStringList findActionNameSystemwide | ( | QKeySequence | seq | |
) |
- See also:
- getGlobalShortcutsByKey
- Deprecated:
[KGlobalShortcutInfo] getGlobalShortcutsByKey | ( | QKeySequence | seq | |
) |
Returns a list of global shortcuts registered for the shortcut @seq.
If the list contains more that one entry it means the component that registered the shortcuts uses global shortcut contexts. All returned shortcuts belong to the same component.
- Since:
- 4.2
bool isComponentActive | ( | QString | componentName | |
) |
Check if component is active.
- Parameters:
-
componentUnique the components unique identifier
- Returns:
- true if active, @false if not
bool isGlobalShortcutAvailable | ( | QKeySequence | seq, | |
QString | component=QString() | |||
) |
Check if the shortcut @seq is available for the component. The component is only of interest if the current application uses global shortcut contexts. In that case a global shortcut by component in an inactive global shortcut contexts does not block the seq for us.
- Since:
- 4.2
bool promptStealShortcutSystemwide | ( | QWidget | parent, | |
[KGlobalShortcutInfo] | shortcuts, | |||
QKeySequence | seq | |||
) |
- See also:
- promptStealShortcutSystemwide below
- Deprecated:
bool promptStealShortcutSystemwide | ( | QWidget | parent, | |
QStringList | actionIdentifier, | |||
QKeySequence | seq | |||
) |
- See also:
- promptStealShortcutSystemwide below
- Deprecated:
KGlobalAccel self | ( | ) |
Returns (and creates if necessary) the singleton instance
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()
Enumeration Documentation
actionIdFields |
Index for actionId QStringLists
- Enumerator:
-
ComponentUnique = 0 ActionUnique = 1 ComponentFriendly = 2 ActionFriendly = 3