Commit 950ab705 authored by Pekka Vuorela's avatar Pekka Vuorela

Use Key type for properties used only for Keys

parent 91828c7a
......@@ -161,7 +161,7 @@ Rectangle {
keyRepeatStarter.stop();
keyRepeatTimer.stop();
key.color = keyboard.keyBgColor;
keyboard.currentKeyPressed = 0;
keyboard.currentKeyPressed = null;
if (sticky && !becomesSticky) {
keyboard.keyModifiers &= ~code
......@@ -184,7 +184,7 @@ Rectangle {
}
// first non-sticky press will cause the sticky to be released
if( !sticky && keyboard.resetSticky != 0 && keyboard.resetSticky !== key ) {
if( !sticky && keyboard.resetSticky && keyboard.resetSticky !== key ) {
resetSticky.setStickiness(0);
}
}
......@@ -211,7 +211,7 @@ Rectangle {
function setStickiness(val)
{
if(sticky) {
if( keyboard.resetSticky != 0 && keyboard.resetSticky !== key ) {
if( keyboard.resetSticky && keyboard.resetSticky !== key ) {
resetSticky.setStickiness(0)
}
......@@ -230,7 +230,7 @@ Rectangle {
keyboard.keyModifiers &= ~code
}
keyboard.resetSticky = 0
keyboard.resetSticky = null
if(stickiness==1) {
stickIndicator.anchors.topMargin = key.height/2
......
......@@ -23,9 +23,9 @@ Item {
id: keyboard
property int keyModifiers
property var resetSticky: 0
property var currentStickyPressed: null
property var currentKeyPressed: 0
property Key resetSticky
property Key currentStickyPressed
property Key currentKeyPressed
property string keyFgColor: "#ffffff"
property string keyBgColor: "#202020"
......@@ -86,7 +86,7 @@ Item {
}
onCurrentKeyPressedChanged: {
if(currentKeyPressed != 0 && currentKeyPressed.currentLabel.length === 1 && currentKeyPressed.currentLabel !== " ") {
if(currentKeyPressed && currentKeyPressed.currentLabel.length === 1 && currentKeyPressed.currentLabel !== " ") {
visualKeyFeedbackRect.label = currentKeyPressed.currentLabel
visualKeyFeedbackRect.width = currentKeyPressed.width*1.5
visualKeyFeedbackRect.height = currentKeyPressed.height*1.5
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment