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
Method Documentation
__init__ | ( | self ) |
Creates a new KGlobalAccel object
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
[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 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 loose on wrong usage are the users 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 isEnabled | ( | self ) |
No effect.
- Deprecated:
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
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:
bool promptStealShortcutSystemwide | ( | QWidget | parent, | |
[KGlobalShortcutInfo] | shortcuts, | |||
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(s). This is GUI only, so nothing will be actually changed.
- See also:
- stealShortcutSystemwide()
- Since:
- 4.2
bool promptStealShortcutSystemwide | ( | QWidget | parent, | |
QStringList | actionIdentifier, | |||
QKeySequence | seq | |||
) |
- See also:
- promptStealShortcutSystemwide below
- Deprecated:
KGlobalAccel self | ( | ) |
Returns (and creates if necessary) the singleton instance
setEnabled | ( | self, | ||
bool | enabled | |||
) |
No effect.
- Deprecated:
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