Commit 97787ebc authored by pvuorela's avatar pvuorela

Merge branch 'home' into 'master'

[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 (27614b8b), 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
parents 0ddd69f0 e72ded21
......@@ -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 ) {
......
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