Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[vkb] Fix toggle keyboard by tapping outside keyboard
  • Loading branch information
Thomas Perl committed Sep 25, 2013
1 parent 28b2ba2 commit cd7a752
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
9 changes: 0 additions & 9 deletions qml/Key.qml
Expand Up @@ -147,15 +147,6 @@ Rectangle {
key.color = keyboard.keyBgColor;
keyboard.currentKeyPressed = 0;

// Wake up the keyboard if the user has tapped/clicked on it and we're not in select mode
//(or it would be hard to select text)
if (y < vkb.y && key.pressMouseY < vkb.y && util.settingsValue("ui/dragMode") !== "select") {
if (vkb.active)
window.sleepVKB();
else
window.wakeVKB();
}

if (sticky) {
keyboard.keyModifiers &= ~code
keyboard.currentStickyPressed = null;
Expand Down
13 changes: 13 additions & 0 deletions qml/Main.qml
Expand Up @@ -158,6 +158,19 @@ PageStackWindow {
onReleased: {
touchPoints.forEach(function (touchPoint) {
if (multiTouchArea.firstTouchId == touchPoint.pointId) {
// Toggle keyboard wake-up when tapping outside the keyboard, but:
// - only when not scrolling (y-diff < 20 pixels)
// - not in select mode, as it would be hard to select text
if (touchPoint.y < vkb.y && touchPoint.startY < vkb.y &&
Math.abs(touchPoint.y - touchPoint.startY) < 20 &&
util.settingsValue("ui/dragMode") !== "select") {
if (vkb.active) {
window.sleepVKB();
} else {
window.wakeVKB();
}
}

//gestures c++ handler
util.mouseRelease(touchPoint.x, touchPoint.y);
multiTouchArea.firstTouchId = -1;
Expand Down

0 comments on commit cd7a752

Please sign in to comment.