Skip to content
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

How to make meta not switch to normal #474

Closed
terrylinooo opened this issue Jul 9, 2016 · 1 comment
Closed

How to make meta not switch to normal #474

terrylinooo opened this issue Jul 9, 2016 · 1 comment

Comments

@terrylinooo
Copy link

Click on the meta button to show meta defined keyboard, click on it again will go back to normal keybaord, It makes users confusing about what is the current keyboard they are using, so I would like to make double-clicking meta button will stay on meta keyboard, does anyone know how to do that?

Thanks!!

@Mottie
Copy link
Owner

Mottie commented Jul 9, 2016

Hi @terrylinooo!

I'm not sure why your users would be confused since the meta key highlights when active (demo).

Anyway, it is possible, but you'd have to unbind the meta keys once the keyboard is visible, then add your own binding to activate the meta keyaction (demo):

visible: function(e, kb){
  kb.$keyboard.find('[data-name^="meta"]')
    .unbind('mousedown' + kb.namespace)
    .bind('dblclick', function(){
      $.keyboard.keyaction.meta(kb, this);
    })
    // add note to title
    .each(function(){
      this.title += " (double click to activate)";
    });
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants