Files
sloposk/qml/Main.qml
T
ericek111andClaude Opus 5.5 ba2f17d665 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>
2026-10-14 21:29:24 +02:00

72 lines
2.3 KiB
QML

import QtQuick
import Sloposk
Window {
id: root
required property LayoutModel layoutModel
required property KeyboardController controller
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
// Outside this, input passes through to whatever is below the window.
readonly property rect inputRegion: keyboard.alternates.open
? Qt.rect(0, 0, width, height)
: Qt.rect(panel.x, panel.y, panel.width, panel.height)
width: 1000
height: 340 + popupMargin
minimumWidth: 480
minimumHeight: 180 + popupMargin
visible: false
color: "transparent"
onInputRegionChanged: placement?.setInputRegion(inputRegion)
onPlacementChanged: placement?.setInputRegion(inputRegion)
Rectangle {
id: panel
anchors { fill: parent; topMargin: root.popupMargin }
radius: Theme.windowRadius
color: Theme.background
Keyboard {
id: keyboard
anchors { left: parent.left; right: parent.right; top: parent.top; bottom: handle.top }
anchors.margins: 2
visible: !root.settingsOpen
model: root.layoutModel
controller: root.controller
}
SettingsPanel {
anchors.fill: keyboard
visible: root.settingsOpen
settings: root.settings
layoutModel: root.layoutModel
}
DragHandle {
id: handle
anchors { left: parent.left; right: parent.right; bottom: parent.bottom }
onMoved: (dx, dy) => root.placement?.moveBy(dx, dy)
}
SettingsButton {
anchors { left: parent.left; leftMargin: 8; bottom: parent.bottom }
checked: root.settingsOpen
onClicked: root.settingsOpen = !root.settingsOpen
}
ResizeHandle {
anchors { right: parent.right; bottom: parent.bottom }
onResized: (dw, dh) => root.placement?.resizeBy(dw, dh)
}
}
}