~unity-2d-team/unity-2d/shortcut-hint-overlay

« back to all changes in this revision

Viewing changes to shell/common/utils.js

  • Committer: Tiago Salem Herrmann
  • Date: 2012-03-19 15:28:41 UTC
  • mfrom: (771.40.182 unity-2d)
  • Revision ID: tiago.herrmann@canonical.com-20120319152841-2hfflo67muks7gca
merge trunk

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
}