Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- a/usr/share/maliit/plugins/com/jolla/KeyboardBase.qml 2017-09-18 08:03:41.644485835 +0200
- +++ b/usr/share/maliit/plugins/com/jolla/KeyboardBase.qml 2017-09-18 08:19:29.014742099 +0200
- @@ -65,7 +65,10 @@
- // counts how many character keys have been pressed since the ActivePoints array was empty
- property int characterKeyCounter
- property bool closeSwipeActive
- + property bool cursorSwipeActive
- property int closeSwipeThreshold: Math.max(height*.3, Theme.itemSizeSmall)
- + property int cursorSwipeThreshold: Theme.itemSizeSmall/8
- + property int cursorSwipeStart: Theme.itemSizeSmall
- property QtObject emptyAttributes: Item {
- property bool isShifted
- @@ -185,6 +188,8 @@
- }
- closeSwipeActive = true
- + cursorSwipeActive = false
- +
- pressTimer.start()
- for (var i = 0; i < touchPoints.length; i++) {
- @@ -225,6 +230,55 @@
- return
- }
- + if (!popper.expanded){
- + if (ActivePoints.array.length === 1
- + && (point.x - point.startX > cursorSwipeThreshold)) {
- + // swiped right
- + if(!cursorSwipeActive && (point.x - point.startX > cursorSwipeStart)) {
- + cursorSwipeActive = true
- + }
- + if(cursorSwipeActive){
- + MInputMethodQuick.sendKey(Qt.Key_Right)
- + if (point.pressedKey) {
- + inputHandler._handleKeyRelease()
- + point.pressedKey.pressed = false
- + }
- + lastPressedKey = null
- + pressTimer.stop()
- + languageSwitchTimer.stop()
- +
- + point.startX = point.x
- + return
- + }
- + }
- +
- +
- +
- +
- + if (ActivePoints.array.length === 1
- + && (point.startX - point.x > cursorSwipeThreshold)) {
- + // swiped left
- + if(!cursorSwipeActive && (point.startX - point.x > cursorSwipeStart)){
- + cursorSwipeActive = true
- + }
- + if(cursorSwipeActive){
- +
- + MInputMethodQuick.sendKey(Qt.Key_Left)
- +
- + if (point.pressedKey) {
- + inputHandler._handleKeyRelease()
- + point.pressedKey.pressed = false
- + }
- + lastPressedKey = null
- + pressTimer.stop()
- + languageSwitchTimer.stop()
- +
- + point.startX = point.x
- + return
- + }
- + }
- + }
- +
- if (popper.expanded && point.pressedKey === lastPressedKey) {
- popper.setActiveCell(point.x, point.y)
- } else {
- @@ -299,7 +353,12 @@
- popper.release()
- point.pressedKey.pressed = false
- } else {
- - triggerKey(point.pressedKey)
- + if(!cursorSwipeActive)
- + triggerKey(point.pressedKey)
- + else if(point.pressedKey !== null) {
- + inputHandler._handleKeyRelease()
- + point.pressedKey.pressed = false
- + }
- }
- if (point.pressedKey.keyType !== KeyType.ShiftKey && !isPressed(KeyType.DeadKey)) {
- @@ -494,3 +553,4 @@
- }
- }
- }
- +
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement