~jbicha/unity-2d/fix-launcher-quicklist-naming-lp949636

« back to all changes in this revision

Viewing changes to shell/common/utils.js

Fix right-to-left keyboard navigation in the dash and in the launcher (LP: #886686). Fixes: https://bugs.launchpad.net/bugs/886686. Approved by Albert Astals Cid.

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
function isRightToLeft() {
45
45
    return Qt.application.layoutDirection == Qt.RightToLeft
46
46
}
 
47
 
 
48
function switchLeftRightKeys(key) {
 
49
    if (isRightToLeft()) {
 
50
        switch (key) {
 
51
        case Qt.Key_Right:
 
52
            return Qt.Key_Left
 
53
        case Qt.Key_Left:
 
54
            return Qt.Key_Right
 
55
        default:
 
56
            return key
 
57
        }
 
58
    }
 
59
    return key
 
60
}