Skip to content
This repository has been archived by the owner on Apr 13, 2022. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Glacier-UI: Implement trackpoint
RevBy: Pekka Vuorela, Michael Hasselmann
  • Loading branch information
locusf authored and mikhas committed Oct 28, 2013
1 parent f65ff8e commit c1ce078
Showing 1 changed file with 61 additions and 9 deletions.
70 changes: 61 additions & 9 deletions nemo-keyboard/org/nemomobile/KeyboardBase.qml
Expand Up @@ -45,14 +45,6 @@ MouseArea {
id: inputHandler
}

BorderImage {
width: 480; height: 318;
border { left: 1; top: 4; right: 1; bottom:0 }
horizontalTileMode: BorderImage.Repeat
verticalTileMode: BorderImage.Repeat
source: "vkb-body.png"
}

Popper {
id: popper
z: 10
Expand All @@ -63,6 +55,63 @@ MouseArea {
interval: 500
}

Rectangle {
id: tracker
width: 30
height: 30
radius: 30
border.width: 2
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
z: 100
color: "#0078bd"
Timer {
id: movetimer
interval: 150
property int key
onTriggered: {
MInputMethodQuick.sendKey(key)
}
}

MouseArea {
width: 45
height: 45
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
property int _startlX
property int _startlY
onPressed: {
_startlX = mouse.x
_startlY = mouse.y
}

onPositionChanged: {
if ((mouse.y + _startlY < (height))) {
movetimer.key = Qt.Key_Up
movetimer.start()
}else if ((mouse.y - _startlY > (height))) {
movetimer.key = Qt.Key_Down
movetimer.start()
}else if ((mouse.x - _startlX < (width))) {
movetimer.key = Qt.Key_Left
movetimer.start()
}else if ((mouse.x + _startlX > (width))) {
movetimer.key = Qt.Key_Right
movetimer.start()
}
}
}
}

BorderImage {
width: 480; height: 318;
border { left: 1; top: 4; right: 1; bottom:0 }
horizontalTileMode: BorderImage.Repeat
verticalTileMode: BorderImage.Repeat
source: "vkb-body.png"
}

Connections {
target: MInputMethodQuick
onCursorPositionChanged: {
Expand All @@ -84,6 +133,10 @@ MouseArea {
property int _startY

onPressed: {
if (keyboard.childAt(mouse.x, mouse.y) == tracker) {
mouse.accepted = false
}

_startX = mouse.x
_startY = mouse.y
pressTimer.start()
Expand Down Expand Up @@ -190,4 +243,3 @@ MouseArea {
}
}
}

0 comments on commit c1ce078

Please sign in to comment.