Full keyboard mode, Ctrl/Alt/Super, dead keys, shift levels
- Full (iPad Pro) mode: every typing key from the keymap, number row, tab, caps lock, ctrl/super/alt; shifted symbol shown above and flickable - Dead keys compose with the locale's XKB compose table - Ctrl/Alt/Super stick like shift and turn keys into shortcuts; a tapped or held shift joins shortcuts and non-text keys, auto-shift and caps lock don't - Auto-capitalization and caps lock only capitalize letters; the user's shift picks the keymap's shifted level - Mode switch in settings keeps key size by resizing the window Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+17
-4
@@ -14,13 +14,26 @@ Item {
|
||||
required property real keyHeight
|
||||
required property bool pressed
|
||||
required property real flickProgress
|
||||
required property string modifier
|
||||
property int shiftMode: KeyboardController.Off
|
||||
property var modifierModes: ({})
|
||||
property bool blank: false // labels hidden, e.g. in trackpad mode
|
||||
|
||||
readonly property bool isCharacter: keyType === "char" || keyType === "space"
|
||||
readonly property bool shiftActive: keyType === "shift" && shiftMode !== KeyboardController.Off
|
||||
// Off / Once / Locked for shift, caps lock and ctrl/alt/super.
|
||||
readonly property int latch: {
|
||||
if (keyType === "shift")
|
||||
return shiftMode
|
||||
if (keyType === "capslock")
|
||||
return shiftMode === KeyboardController.Locked ? KeyboardController.Locked : KeyboardController.Off
|
||||
if (keyType === "modifier")
|
||||
return modifierModes[modifier] ?? KeyboardController.Off
|
||||
return KeyboardController.Off
|
||||
}
|
||||
// Shift shows locking with its glyph; the others turn accent-coloured.
|
||||
readonly property bool locked: latch === KeyboardController.Locked && keyType !== "shift"
|
||||
// Character keys darken when pressed; function keys lighten (as on iPad).
|
||||
readonly property bool lit: (isCharacter !== pressed) || shiftActive
|
||||
readonly property bool lit: (isCharacter !== pressed) || latch !== KeyboardController.Off
|
||||
|
||||
readonly property var defaultGlyphs: ({
|
||||
backspace: "⌫",
|
||||
@@ -51,7 +64,7 @@ Item {
|
||||
id: face
|
||||
anchors.fill: parent
|
||||
radius: Theme.keyRadius
|
||||
color: key.lit ? Theme.characterKey : Theme.functionKey
|
||||
color: key.locked ? Theme.accent : key.lit ? Theme.characterKey : Theme.functionKey
|
||||
}
|
||||
|
||||
// Flicking slides the secondary symbol down into the main position.
|
||||
@@ -81,7 +94,7 @@ Item {
|
||||
verticalCenterOffset: flick.visible ? key.height * 0.14 : 0
|
||||
}
|
||||
font.pixelSize: key.height * (key.isWord ? 0.24 : flick.visible ? 0.34 : 0.4)
|
||||
color: Theme.text
|
||||
color: key.locked ? Theme.accentText : Theme.text
|
||||
visible: !key.blank
|
||||
opacity: 1 - key.flickProgress
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ KeyboardSurface {
|
||||
model: surface.model
|
||||
delegate: Key {
|
||||
shiftMode: surface.controller ? surface.controller.shiftMode : KeyboardController.Off
|
||||
modifierModes: surface.controller ? surface.controller.modifierModes : ({})
|
||||
blank: surface.trackpadActive
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@ Window {
|
||||
required property Settings settings
|
||||
property var placement: null // FloatingWindow, set from C++
|
||||
property bool settingsOpen: false
|
||||
// Height of the key area, for C++ keeping key sizes when rows change.
|
||||
readonly property real keysHeight: keyboard.height
|
||||
|
||||
// Transparent room above the keyboard for long-press popups on the top row.
|
||||
readonly property real popupMargin: 90
|
||||
|
||||
@@ -47,6 +47,14 @@ Rectangle {
|
||||
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user