Files
sloposk/qml/SettingsPanel.qml
T
ericek111andClaude Opus 5.5 e02b1a8237 Hold Keys mode: keys stay down while touched, like a hardware keyboard
- HardwareKeys presses a key's unshifted keysym on touch and releases it
  on lift, through fake input; held keys repeat and combine as on a
  physical keyboard (games, Shift+click)
- Shift/Ctrl/Alt/Super are plain held keys, caps lock is the system's,
  dead keys compose in the app
- No long-press, flick, trackpad or rollover in this mode; nothing is
  left held when the mode is turned off or touches are cancelled
- Settings switch; default stays the touch (virtual keyboard) mode

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 22:17:11 +02:00

89 lines
2.9 KiB
QML

import QtQuick
import Sloposk
// Replaces the keys while open. Binds straight to Settings, which persists.
Rectangle {
id: panel
required property Settings settings
required property LayoutModel layoutModel
color: Theme.background
radius: Theme.windowRadius
Row {
id: columns
readonly property real columnWidth: (width - spacing) / 2
anchors { fill: parent; margins: 16 }
spacing: 32
Column {
width: columns.columnWidth
spacing: 4
SectionHeader { text: qsTr("Typing") }
ToggleRow {
width: parent.width
text: qsTr("Auto-Capitalization")
detail: qsTr("Shift at the start of a sentence")
checked: panel.settings.autoCapitalize
onToggled: checked => panel.settings.autoCapitalize = checked
}
ToggleRow {
width: parent.width
text: qsTr("Hold Keys")
detail: qsTr("Keys stay down while touched, like a hardware keyboard; no accents or flicks")
checked: panel.settings.holdKeys
onToggled: checked => panel.settings.holdKeys = checked
}
ToggleRow {
width: parent.width
text: qsTr("Always Show")
detail: qsTr("Type into any window, not just text fields")
checked: panel.settings.alwaysVisible
onToggled: checked => panel.settings.alwaysVisible = checked
}
ToggleRow {
width: parent.width
text: qsTr("“.” Shortcut")
detail: qsTr("Double-tap space for a period and a space")
checked: panel.settings.doubleSpacePeriod
onToggled: checked => panel.settings.doubleSpacePeriod = checked
}
}
Column {
width: columns.columnWidth
spacing: 4
SectionHeader { text: qsTr("Keys") }
ToggleRow {
width: parent.width
text: qsTr("Full Keyboard")
detail: qsTr("Number row, tab, ctrl, alt — like iPad Pro")
checked: panel.settings.fullKeyboard
onToggled: checked => panel.settings.fullKeyboard = checked
}
Repeater {
// "main" is the typing keys; the rest come from the template.
model: [{ id: "main", name: qsTr("Typing keys") }].concat(panel.layoutModel.sections)
ToggleRow {
required property var modelData
width: parent.width
text: modelData.name
checked: panel.settings.visibleSections.includes(modelData.id)
onToggled: checked => panel.settings.setSectionVisible(modelData.id, checked)
}
}
}
}
}