KDE 4.2 PyKDE API Reference
  • KDE's Python API
  • Overview
  • PyKDE Home
  • Sitemap
  • Contact Us
 

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())
QStringList findActionNameSystemwide (QKeySequence seq)
[KGlobalShortcutInfo] getGlobalShortcutsByKey (QKeySequence seq)
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 )

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:

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 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

  • Full Index

Modules

  • akonadi
  • dnssd
  • kdecore
  • kdeui
  • khtml
  • kio
  • knewstuff
  • kparts
  • kutils
  • nepomuk
  • phonon
  • plasma
  • solid
  • soprano
This documentation is maintained by Simon Edwards.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal