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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user