Skip to content

Commit

Permalink
Core: Add getKeySet method. See #504
Browse files Browse the repository at this point in the history
  • Loading branch information
Mottie committed Jan 8, 2017
1 parent f37eebd commit 3c9323f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions js/jquery.keyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -1241,6 +1241,22 @@ http://www.opensource.org/licenses/mit-license.php
}
};

base.getKeySet = function () {
var sets = [];
if (base.altActive) {
sets.push('alt');
}
if (base.shiftActive) {
sets.push('shift');
}
if (base.metaActive) {
// base.metaActive contains the string name of the
// current meta keyset
sets.push(base.metaActive);
}
return sets.length ? sets.join('+') : 'normal';
};

// make it easier to switch keysets via API
// showKeySet('shift+alt+meta1')
base.showKeySet = function (str) {
Expand Down

0 comments on commit 3c9323f

Please sign in to comment.