mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 08:23:04 +02:00
Combine numeric keys into alpha keyboard QML file for scrolling windows
This commit is contained in:
parent
b954852ba9
commit
5a4665b02f
2 changed files with 244 additions and 61 deletions
|
@ -12,8 +12,15 @@ import QtQuick 2.0
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: keyboardBase
|
id: keyboardBase
|
||||||
height: 200
|
|
||||||
property alias shiftKey: key27
|
property bool raised: false
|
||||||
|
property bool numeric: false
|
||||||
|
|
||||||
|
readonly property int raisedHeight: 200
|
||||||
|
|
||||||
|
height: enabled && raised ? raisedHeight : 0
|
||||||
|
visible: enabled && raised
|
||||||
|
|
||||||
property bool shiftMode: false
|
property bool shiftMode: false
|
||||||
|
|
||||||
function resetShiftMode(mode) {
|
function resetShiftMode(mode) {
|
||||||
|
@ -47,8 +54,8 @@ Item {
|
||||||
|
|
||||||
function forEachKey(func) {
|
function forEachKey(func) {
|
||||||
var i, j;
|
var i, j;
|
||||||
for (i = 0; i < column1.children.length; i++) {
|
for (i = 0; i < columnAlpha.children.length; i++) {
|
||||||
var row = column1.children[i];
|
var row = columnAlpha.children[i];
|
||||||
for (j = 0; j < row.children.length; j++) {
|
for (j = 0; j < row.children.length; j++) {
|
||||||
var key = row.children[j];
|
var key = row.children[j];
|
||||||
func(key);
|
func(key);
|
||||||
|
@ -107,146 +114,124 @@ Item {
|
||||||
anchors.bottomMargin: 0
|
anchors.bottomMargin: 0
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
id: column1
|
id: columnAlpha
|
||||||
width: 480
|
width: 480
|
||||||
height: 200
|
height: 200
|
||||||
|
visible: !numeric
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
id: row1
|
|
||||||
width: 480
|
width: 480
|
||||||
height: 50
|
height: 50
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.leftMargin: 0
|
anchors.leftMargin: 0
|
||||||
|
|
||||||
Key {
|
Key {
|
||||||
id: key1
|
|
||||||
width: 44
|
width: 44
|
||||||
glyph: "q"
|
glyph: "q"
|
||||||
}
|
}
|
||||||
|
|
||||||
Key {
|
Key {
|
||||||
id: key2
|
|
||||||
width: 44
|
width: 44
|
||||||
glyph: "w"
|
glyph: "w"
|
||||||
}
|
}
|
||||||
|
|
||||||
Key {
|
Key {
|
||||||
id: key3
|
|
||||||
width: 44
|
width: 44
|
||||||
glyph: "e"
|
glyph: "e"
|
||||||
}
|
}
|
||||||
|
|
||||||
Key {
|
Key {
|
||||||
id: key4
|
|
||||||
width: 43
|
width: 43
|
||||||
glyph: "r"
|
glyph: "r"
|
||||||
}
|
}
|
||||||
|
|
||||||
Key {
|
Key {
|
||||||
id: key5
|
|
||||||
width: 43
|
width: 43
|
||||||
glyph: "t"
|
glyph: "t"
|
||||||
}
|
}
|
||||||
|
|
||||||
Key {
|
Key {
|
||||||
id: key6
|
|
||||||
width: 44
|
width: 44
|
||||||
glyph: "y"
|
glyph: "y"
|
||||||
}
|
}
|
||||||
|
|
||||||
Key {
|
Key {
|
||||||
id: key7
|
|
||||||
width: 44
|
width: 44
|
||||||
glyph: "u"
|
glyph: "u"
|
||||||
}
|
}
|
||||||
|
|
||||||
Key {
|
Key {
|
||||||
id: key8
|
|
||||||
width: 43
|
width: 43
|
||||||
glyph: "i"
|
glyph: "i"
|
||||||
}
|
}
|
||||||
|
|
||||||
Key {
|
Key {
|
||||||
id: key9
|
|
||||||
width: 42
|
width: 42
|
||||||
glyph: "o"
|
glyph: "o"
|
||||||
}
|
}
|
||||||
|
|
||||||
Key {
|
Key {
|
||||||
id: key10
|
|
||||||
width: 44
|
width: 44
|
||||||
glyph: "p"
|
glyph: "p"
|
||||||
}
|
}
|
||||||
|
|
||||||
Key {
|
Key {
|
||||||
id: key28
|
|
||||||
width: 45
|
width: 45
|
||||||
glyph: "←"
|
glyph: "←"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
id: row2
|
|
||||||
width: 480
|
width: 480
|
||||||
height: 50
|
height: 50
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.leftMargin: 18
|
anchors.leftMargin: 18
|
||||||
|
|
||||||
Key {
|
Key {
|
||||||
id: key11
|
|
||||||
width: 43
|
width: 43
|
||||||
}
|
}
|
||||||
|
|
||||||
Key {
|
Key {
|
||||||
id: key12
|
|
||||||
width: 43
|
width: 43
|
||||||
glyph: "s"
|
glyph: "s"
|
||||||
}
|
}
|
||||||
|
|
||||||
Key {
|
Key {
|
||||||
id: key13
|
|
||||||
width: 43
|
width: 43
|
||||||
glyph: "d"
|
glyph: "d"
|
||||||
}
|
}
|
||||||
|
|
||||||
Key {
|
Key {
|
||||||
id: key14
|
|
||||||
width: 43
|
width: 43
|
||||||
glyph: "f"
|
glyph: "f"
|
||||||
}
|
}
|
||||||
|
|
||||||
Key {
|
Key {
|
||||||
id: key15
|
|
||||||
width: 43
|
width: 43
|
||||||
glyph: "g"
|
glyph: "g"
|
||||||
}
|
}
|
||||||
|
|
||||||
Key {
|
Key {
|
||||||
id: key16
|
|
||||||
width: 43
|
width: 43
|
||||||
glyph: "h"
|
glyph: "h"
|
||||||
}
|
}
|
||||||
|
|
||||||
Key {
|
Key {
|
||||||
id: key17
|
|
||||||
width: 43
|
width: 43
|
||||||
glyph: "j"
|
glyph: "j"
|
||||||
}
|
}
|
||||||
|
|
||||||
Key {
|
Key {
|
||||||
id: key18
|
|
||||||
width: 43
|
width: 43
|
||||||
glyph: "k"
|
glyph: "k"
|
||||||
}
|
}
|
||||||
|
|
||||||
Key {
|
Key {
|
||||||
id: key19
|
|
||||||
width: 43
|
width: 43
|
||||||
glyph: "l"
|
glyph: "l"
|
||||||
}
|
}
|
||||||
|
|
||||||
Key {
|
Key {
|
||||||
id: key32
|
|
||||||
width: 75
|
width: 75
|
||||||
glyph: "⏎"
|
glyph: "⏎"
|
||||||
}
|
}
|
||||||
|
@ -260,7 +245,7 @@ Item {
|
||||||
anchors.leftMargin: 0
|
anchors.leftMargin: 0
|
||||||
|
|
||||||
Key {
|
Key {
|
||||||
id: key27
|
id: shiftKey
|
||||||
width: 46
|
width: 46
|
||||||
glyph: "⇪"
|
glyph: "⇪"
|
||||||
toggle: true
|
toggle: true
|
||||||
|
@ -270,61 +255,51 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
Key {
|
Key {
|
||||||
id: key20
|
|
||||||
width: 43
|
width: 43
|
||||||
glyph: "z"
|
glyph: "z"
|
||||||
}
|
}
|
||||||
|
|
||||||
Key {
|
Key {
|
||||||
id: key21
|
|
||||||
width: 43
|
width: 43
|
||||||
glyph: "x"
|
glyph: "x"
|
||||||
}
|
}
|
||||||
|
|
||||||
Key {
|
Key {
|
||||||
id: key22
|
|
||||||
width: 43
|
width: 43
|
||||||
glyph: "c"
|
glyph: "c"
|
||||||
}
|
}
|
||||||
|
|
||||||
Key {
|
Key {
|
||||||
id: key23
|
|
||||||
width: 43
|
width: 43
|
||||||
glyph: "v"
|
glyph: "v"
|
||||||
}
|
}
|
||||||
|
|
||||||
Key {
|
Key {
|
||||||
id: key24
|
|
||||||
width: 43
|
width: 43
|
||||||
glyph: "b"
|
glyph: "b"
|
||||||
}
|
}
|
||||||
|
|
||||||
Key {
|
Key {
|
||||||
id: key25
|
|
||||||
width: 43
|
width: 43
|
||||||
glyph: "n"
|
glyph: "n"
|
||||||
}
|
}
|
||||||
|
|
||||||
Key {
|
Key {
|
||||||
id: key26
|
|
||||||
width: 44
|
width: 44
|
||||||
glyph: "m"
|
glyph: "m"
|
||||||
}
|
}
|
||||||
|
|
||||||
Key {
|
Key {
|
||||||
id: key31
|
|
||||||
width: 43
|
width: 43
|
||||||
glyph: "_"
|
glyph: "_"
|
||||||
}
|
}
|
||||||
|
|
||||||
Key {
|
Key {
|
||||||
id: key33
|
|
||||||
width: 43
|
width: 43
|
||||||
glyph: "?"
|
glyph: "?"
|
||||||
}
|
}
|
||||||
|
|
||||||
Key {
|
Key {
|
||||||
id: key36
|
|
||||||
width: 46
|
width: 46
|
||||||
glyph: "/"
|
glyph: "/"
|
||||||
}
|
}
|
||||||
|
@ -332,14 +307,12 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
id: row4
|
|
||||||
width: 480
|
width: 480
|
||||||
height: 50
|
height: 50
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.leftMargin: 19
|
anchors.leftMargin: 19
|
||||||
|
|
||||||
Key {
|
Key {
|
||||||
id: key30
|
|
||||||
width: 89
|
width: 89
|
||||||
glyph: "&123"
|
glyph: "&123"
|
||||||
mouseArea.onClicked: {
|
mouseArea.onClicked: {
|
||||||
|
@ -348,19 +321,242 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
Key {
|
Key {
|
||||||
id: key29
|
|
||||||
width: 285
|
width: 285
|
||||||
glyph: " "
|
glyph: " "
|
||||||
}
|
}
|
||||||
|
|
||||||
Key {
|
Key {
|
||||||
id: key34
|
|
||||||
width: 43
|
width: 43
|
||||||
glyph: "⇦"
|
glyph: "⇦"
|
||||||
}
|
}
|
||||||
|
|
||||||
Key {
|
Key {
|
||||||
id: key35
|
x: 343
|
||||||
|
width: 43
|
||||||
|
glyph: "⇨"
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Column {
|
||||||
|
id: columnNumeric
|
||||||
|
width: 480
|
||||||
|
height: 200
|
||||||
|
visible: numeric
|
||||||
|
|
||||||
|
Row {
|
||||||
|
width: 480
|
||||||
|
height: 50
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.leftMargin: 0
|
||||||
|
|
||||||
|
Key {
|
||||||
|
width: 43
|
||||||
|
glyph: "1"
|
||||||
|
}
|
||||||
|
|
||||||
|
Key {
|
||||||
|
width: 43
|
||||||
|
glyph: "2"
|
||||||
|
}
|
||||||
|
|
||||||
|
Key {
|
||||||
|
width: 43
|
||||||
|
glyph: "3"
|
||||||
|
}
|
||||||
|
|
||||||
|
Key {
|
||||||
|
width: 43
|
||||||
|
glyph: "4"
|
||||||
|
}
|
||||||
|
|
||||||
|
Key {
|
||||||
|
width: 43
|
||||||
|
glyph: "5"
|
||||||
|
}
|
||||||
|
|
||||||
|
Key {
|
||||||
|
width: 43
|
||||||
|
glyph: "6"
|
||||||
|
}
|
||||||
|
|
||||||
|
Key {
|
||||||
|
width: 43
|
||||||
|
glyph: "7"
|
||||||
|
}
|
||||||
|
|
||||||
|
Key {
|
||||||
|
width: 43
|
||||||
|
glyph: "8"
|
||||||
|
}
|
||||||
|
|
||||||
|
Key {
|
||||||
|
width: 43
|
||||||
|
glyph: "9"
|
||||||
|
}
|
||||||
|
|
||||||
|
Key {
|
||||||
|
width: 43
|
||||||
|
glyph: "0"
|
||||||
|
}
|
||||||
|
|
||||||
|
Key {
|
||||||
|
width: 50
|
||||||
|
glyph: "←"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Row {
|
||||||
|
width: 480
|
||||||
|
height: 50
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.leftMargin: 0
|
||||||
|
|
||||||
|
Key {
|
||||||
|
width: 43
|
||||||
|
glyph: "!"
|
||||||
|
}
|
||||||
|
|
||||||
|
Key {
|
||||||
|
width: 43
|
||||||
|
glyph: "@"
|
||||||
|
}
|
||||||
|
|
||||||
|
Key {
|
||||||
|
width: 43
|
||||||
|
glyph: "#"
|
||||||
|
}
|
||||||
|
|
||||||
|
Key {
|
||||||
|
width: 43
|
||||||
|
glyph: "$"
|
||||||
|
}
|
||||||
|
|
||||||
|
Key {
|
||||||
|
width: 43
|
||||||
|
glyph: "%"
|
||||||
|
}
|
||||||
|
|
||||||
|
Key {
|
||||||
|
width: 43
|
||||||
|
glyph: "^"
|
||||||
|
}
|
||||||
|
|
||||||
|
Key {
|
||||||
|
width: 43
|
||||||
|
glyph: "&"
|
||||||
|
}
|
||||||
|
|
||||||
|
Key {
|
||||||
|
width: 43
|
||||||
|
glyph: "*"
|
||||||
|
}
|
||||||
|
|
||||||
|
Key {
|
||||||
|
width: 43
|
||||||
|
glyph: "("
|
||||||
|
}
|
||||||
|
|
||||||
|
Key {
|
||||||
|
width: 43
|
||||||
|
glyph: ")"
|
||||||
|
}
|
||||||
|
|
||||||
|
Key {
|
||||||
|
width: 50
|
||||||
|
glyph: "⏎"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Row {
|
||||||
|
width: 480
|
||||||
|
height: 50
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.leftMargin: 4
|
||||||
|
|
||||||
|
Key {
|
||||||
|
width: 43
|
||||||
|
glyph: "="
|
||||||
|
}
|
||||||
|
|
||||||
|
Key {
|
||||||
|
width: 43
|
||||||
|
glyph: "+"
|
||||||
|
}
|
||||||
|
|
||||||
|
Key {
|
||||||
|
width: 43
|
||||||
|
glyph: "-"
|
||||||
|
}
|
||||||
|
|
||||||
|
Key {
|
||||||
|
width: 43
|
||||||
|
glyph: ","
|
||||||
|
}
|
||||||
|
|
||||||
|
Key {
|
||||||
|
width: 43
|
||||||
|
glyph: "."
|
||||||
|
}
|
||||||
|
|
||||||
|
Key {
|
||||||
|
width: 43
|
||||||
|
glyph: ";"
|
||||||
|
}
|
||||||
|
|
||||||
|
Key {
|
||||||
|
width: 43
|
||||||
|
glyph: ":"
|
||||||
|
}
|
||||||
|
|
||||||
|
Key {
|
||||||
|
width: 43
|
||||||
|
glyph: "'"
|
||||||
|
}
|
||||||
|
|
||||||
|
Key {
|
||||||
|
width: 43
|
||||||
|
glyph: "\""
|
||||||
|
}
|
||||||
|
|
||||||
|
Key {
|
||||||
|
width: 43
|
||||||
|
glyph: "<"
|
||||||
|
}
|
||||||
|
|
||||||
|
Key {
|
||||||
|
width: 43
|
||||||
|
glyph: ">"
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Row {
|
||||||
|
width: 480
|
||||||
|
height: 50
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.leftMargin: 19
|
||||||
|
|
||||||
|
Key {
|
||||||
|
width: 65
|
||||||
|
glyph: "abc"
|
||||||
|
mouseArea.onClicked: {
|
||||||
|
keyboardBase.parent.punctuationMode = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Key {
|
||||||
|
width: 285
|
||||||
|
glyph: " "
|
||||||
|
}
|
||||||
|
|
||||||
|
Key {
|
||||||
|
width: 43
|
||||||
|
glyph: "⇦"
|
||||||
|
}
|
||||||
|
|
||||||
|
Key {
|
||||||
x: 343
|
x: 343
|
||||||
width: 43
|
width: 43
|
||||||
glyph: "⇨"
|
glyph: "⇨"
|
||||||
|
|
|
@ -180,23 +180,10 @@ Window {
|
||||||
children: [ footer ]
|
children: [ footer ]
|
||||||
}
|
}
|
||||||
|
|
||||||
HiFiControls.KeyboardAlpha {
|
HiFiControls.Keyboard {
|
||||||
id: keyboard1
|
enabled: keyboardEnabled
|
||||||
height: parent.keyboardEnabled && parent.keyboardRaised ? 200 : 0
|
raised: keyboardRaised
|
||||||
visible: parent.keyboardEnabled && parent.keyboardRaised && !parent.punctuationMode
|
numeric: punctuationMode
|
||||||
enabled: parent.keyboardEnabled && parent.keyboardRaised && !parent.punctuationMode
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
bottom: parent.bottom
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
HiFiControls.KeyboardPunctuation {
|
|
||||||
id: keyboard2
|
|
||||||
height: parent.keyboardEnabled && parent.keyboardRaised ? 200 : 0
|
|
||||||
visible: parent.keyboardEnabled && parent.keyboardRaised && parent.punctuationMode
|
|
||||||
enabled: parent.keyboardEnabled && parent.keyboardRaised && parent.punctuationMode
|
|
||||||
anchors {
|
anchors {
|
||||||
left: parent.left
|
left: parent.left
|
||||||
right: parent.right
|
right: parent.right
|
||||||
|
|
Loading…
Reference in a new issue