class KShortcut


Module kdeui
Namespace
Class KShortcut
Inherits
Represents a keyboard shortcut

The KShortcut class is used to represent a keyboard shortcut to an action. A shortcut is normally a single key with modifiers, such as Ctrl+V. A KShortcut object may also contain an alternate key sequence which will also activate the action it's associated with, as long as no other actions have defined that key as their primary key. Ex: Ctrl+V;Shift+Insert.

This can be used to add additional accelerators to a KAction. For example, the below code binds the escape key to the close action.

KAction *closeAction = KStandardAction.close(this, SLOT( close() ), actionCollection());
KShortcut closeShortcut = closeAction->shortcut();
closeShortcut.setAlternate(Qt.Key_Escape);
closeAction->setShortcut(closeShortcut);


enums

enum details

methods