Skip to content

Commit

Permalink
Merge branch 'home' into 'master'
Browse files Browse the repository at this point in the history
[fingerterm] Don't apply shift on keys that are accessible only with shift.

As reported in TJC https://together.jolla.com/question/142010/bug-terminal-buttons-homeend-dont-work/ the Home / End buttons don't work anymore.

This is due to a commit in Fingerterm (27614b8), allowing modifiers for special keys (see terminal.cpp). Before this commit, home was always sending ^[OF whatever the modifier. The commit is nice but it is not taking into account the fact that some special keys are only reachable when Shift is pressed, like home and end. The proposed MR corrects this, by removing the shift modifier if the _alt version of the key is different from the standard version of the key. I think like that the code in terminal.cpp is kept generic and we treat only the issue commit from the layouting from whatever character.

This is WIP because currently, it's not only removing the shift modifier but all modifier because the code for the shift modifier is not globally known. It corrects the bug, but it's not clean.

@pvuorela, whatdo you think ?

See merge request !16
  • Loading branch information
pvuorela committed Dec 5, 2016
2 parents 0ddd69f + e72ded2 commit 97787eb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion qml/Key.qml
Expand Up @@ -175,7 +175,13 @@ Rectangle {
setStickiness(-1);
}

window.vkbKeypress(currentCode, keyboard.keyModifiers);
if (shiftActive && code_alt != 0 && code_alt != code) {
// Do not apply shift on alt code that are accessible
// only with shift.
window.vkbKeypress(currentCode, keyboard.keyModifiers & ~Qt.ShiftModifier);
} else {
window.vkbKeypress(currentCode, keyboard.keyModifiers);
}

// first non-sticky press will cause the sticky to be released
if( !sticky && keyboard.resetSticky != 0 && keyboard.resetSticky !== key ) {
Expand Down

0 comments on commit 97787eb

Please sign in to comment.