# class KKeySequenceWidget

###

Module | kdeui
Namespace |
Class | KKeySequenceWidget
Inherits | QWidget

A widget to input a QKeySequence.

This widget lets the user choose a QKeySequence, which is usually used as a shortcut key, by pressing the keys just like to trigger a shortcut. Calling captureKeySequence(), or the user clicking into the widget, start recording.

A check for conflict with shortcut of this application can also be performed. call setCheckActionCollections() to set the list of action collections to check with, and applyStealShortcut when applying changes.

Author Mark Donohoe <donohoe@kde.org> Internal

### enums

- Validation { Validate, NoValidate }

enum details

### methods

- KKeySequenceWidget (parent)

  returns ctor
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  parent | QWidget | 0

  Constructor.

- KKeySequenceWidget (a0)

  returns ctor
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  a0 | KKeySequenceWidget |

- KKeySequenceWidget (a0)

  returns ctor
  before KDE 4.1.0 only

  Argument | Type | Default
  --- | --- | ---
  a0 | QWidget | 0

- applyStealShortcut ( )

  returns Nothing

  Actually remove the shortcut that the user wanted to steal, from the action that was using it.

  To be called before you apply your changes. No shortcuts are stolen until this function is called.

- captureKeySequence ( )

  returns Nothing

  Capture a shortcut from the keyboard. This call will only return once a key sequence has been captured or input was aborted. If a key sequence was input, keySequenceChanged() will be emitted.

  See also setModifierlessAllowed()

- clearKeySequence ( )

  returns Nothing

  Clear the key sequence.

- isModifierlessAllowed ( )

  returns bool

  See also setModifierlessAllowed()

- keySequence ( )

  returns QKeySequence

  Return the currently selected key sequence.

- keySequenceChanged (seq)

  returns Nothing
  SIGNAL ("keySequenceChanged (const QKeySequence&)")

  Argument | Type | Default
  --- | --- | ---
  seq | QKeySequence |

  This signal is emitted when the current key sequence has changed, be it by user input or programmatically.

- setCheckActionCollections (actionCollections)

  returns Nothing
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  actionCollections | QList<KActionCollection |

  Set a list of action collections to check against for conflictuous shortcut.

  If there is a conflictuous shortcut with a KAction, and its shortcut can be configured (KAction.isShortcutConfigurable() returns true) the user will be prompted whether to steal the shortcut from this action.

  Global shortcuts are automatically checked for conflicts

  Don't forget to call applyStealShortcut to actually steal the shortcut.

  @since 4.1

- setCheckActionList (checkList)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  checkList | QList<QAction |

  Deprecated since 4.1 use setCheckActionCollections so that KKeySequenceWidget knows in which action collection to call the writeSettings method after stealing a shortcut from an action.

- setClearButtonShown (show)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  show | bool |

  Set whether a small button to set an empty key sequence should be displayed next to the main input widget. The default is to show the clear button.

- setKeySequence (seq, val)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  seq | QKeySequence |
  val | KKeySequenceWidget.Validation | KKeySequenceWidget.NoValidate

  Set the key sequence.

  If val == Validate, and the call is actually changing the key sequence, conflictuous shortcut will be checked.

- setModifierlessAllowed (allow)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  allow | bool |

  This only applies to user input, not to setShortcut(). Set whether to accept "plain" keys without modifiers (like Ctrl, Alt, Meta). Plain keys by our definition include letter and symbol keys and text editing keys (Return, Space, Tab, Backspace, Delete). "Special" keys like F1, Cursor keys, Insert, PageDown will always work.

### enums - detail

- Validation { Validate, NoValidate }

  Validate key sequence

  | Validate | - 0 | - |
  | NoValidate | - 1 | - |