-
Notifications
You must be signed in to change notification settings - Fork 724
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting current KeySet #504
Comments
Yes, it's not built in, maybe it should be, but you can use the "keysetChange" event to check (demo): $(function() {
$('#keyboard')
.keyboard({
layout: "international"
})
.on('keysetChange', function(event, keyboard, element) {
// keyset changes before keyboard is visible
if (keyboard.isVisible()) {
var keyset = keyboard.$keyboard.find('.ui-keyboard-keyset:visible');
console.log("current keyset = " + keyset.attr('name'));
}
});
}); or, you can check individual keysets: keyboard.shiftActive // true when shift is active; false when not
keyboard.altActive // true when alt is active; false when not
keyboard.metaActive // contains the string name of the meta set when active; false when not |
Ah thanks! That's exactly what I needed! :) Btw, can there be any more customLayouts and can the alternative keysets have names different from shift and metaX? Right now I use 3 layouts (probably going to trim that using the keysets, so using natural names instead of metaX might just come in handy) using `$.keyboard.layouts.NAME = {"default" : []}', which you strongly advise against haha. |
The |
Actually, the way the code is set up, you could add an underscore in the meta key name to describe it... something like |
Ah nice, that's really useful! I didn't realize that this was the way to go as I used the different layouts initially. Thanks again! :) |
Ah very nice! More freedom :) Haha, don't worry about it, it's a small thing really :p |
Aw yeah! :D |
Hi @Mottie,
One last question: Is it possible to get the current active keyset?
The text was updated successfully, but these errors were encountered: