Skip to content

UniDeskHotkeyPicker Type

Shortcut key picker control based on UniDeskButton. Click to open a dialog where users can press a key combination to set a shortcut.

ProjectDescription
Control TypeVisual Control
Source FileUniDesk/Controls/UniDeskHotkeyPicker.qml
InheritsUniDeskButton
QML Importimport UniDesk.Controls 1.0

Custom Properties

PropertyTypeDefaultDescription
currentlist<string>["Ctrl", "Shift", "A"]Current shortcut key combination
titlestring"Activate Shortcut"Dialog title
messagestring"Press a key combination to change the shortcut"Dialog message
positiveTextstring"Save"Save button text
neutralTextstring"Cancel"Cancel button text
negativeTextstring"Reset"Reset button text
registeredbooltrueWhether the shortcut is registered (shows conflict when false)
errorColorcolorRedConflict error color

Signals

accepted()

Emitted when the user clicks the Save button.

Features

  • Click button to open UniDeskDialog
  • Captures keyboard input in the dialog (supports Ctrl, Shift, Alt modifiers)
  • Keys converted to strings via keyToString()
  • Save, Cancel, Reset operations
  • Shortcut displayed as capsule-shaped chips

Example

qml
import UniDesk.Controls 1.0

UniDeskHotkeyPicker {
    current: ["Ctrl", "Shift", "S"]
    title: "Save Shortcut"
    onAccepted: console.log("Shortcut saved")
}

Released under the CC BY-SA 4.0 open documentation license.