Spike: KWin input-method backend with floating layer-shell window
Registers as KWin's virtual keyboard (input-method-unstable-v1), shows a non-focusable layer-shell overlay, and commits Unicode text. Verified in a nested headless KWin with the textprobe tool. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
// Spike UI: proves text commits, keysyms and dragging. Replaced by the real
|
||||
// keyboard in milestone 2.
|
||||
Window {
|
||||
id: root
|
||||
|
||||
required property var backend
|
||||
property var placement: null
|
||||
|
||||
width: 720
|
||||
height: 120
|
||||
visible: false
|
||||
color: "#d1d3d9"
|
||||
|
||||
Rectangle {
|
||||
id: handle
|
||||
anchors { horizontalCenter: parent.horizontalCenter; bottom: parent.bottom; bottomMargin: 6 }
|
||||
width: 120; height: 6; radius: 3
|
||||
color: "#8e8e93"
|
||||
|
||||
DragHandler {
|
||||
target: null
|
||||
margin: 12
|
||||
property point last
|
||||
onActiveChanged: last = centroid.scenePressPosition
|
||||
onCentroidChanged: {
|
||||
if (!active || !root.placement)
|
||||
return
|
||||
const p = centroid.scenePosition
|
||||
root.placement.moveBy(p.x - last.x, p.y - last.y)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Row {
|
||||
anchors.centerIn: parent
|
||||
spacing: 8
|
||||
Button { text: "héllo👍"; focusPolicy: Qt.NoFocus; onClicked: root.backend.commitText(text) }
|
||||
Button { text: "⌫"; focusPolicy: Qt.NoFocus; onClicked: root.backend.sendKeysym(0xff08) }
|
||||
Button { text: "⏎"; focusPolicy: Qt.NoFocus; onClicked: root.backend.sendKeysym(0xff0d) }
|
||||
Label { anchors.verticalCenter: parent.verticalCenter; text: root.backend.active ? "active" : "inactive" }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user