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

Support Command key on OS X #2

Open
statico opened this issue Nov 14, 2011 · 5 comments
Open

Support Command key on OS X #2

statico opened this issue Nov 14, 2011 · 5 comments

Comments

@statico
Copy link

statico commented Nov 14, 2011

Kibo needs support of the meta modifier so I can avoid trapping useful keystrokes such as Command-R (reload the page).

Thanks for a useful library!

@marquete
Copy link
Owner

Hi, statico.

I will look into this, as you and others have suggested that I add support for certain keys that I didn't initially consider (because of compatibility or unwanted behaviour such as defaults that couldn't be prevented). Thanks for your feedback!

@ignacioiglesias
Copy link

You can detect meta keys in some browsers but there are some limitations.

Kibo.KEY_NAMES_BY_CODE and Kibo.MODIFIERS can be modified to detect meta key codes but I'm afraid that doing that could cause some pollution, specially because the codes aren't the same in every browser.

On my Mac, Firefox detects the key code as 224, Webkit detects 91 for the left key and 93 for the right one. For Windows keys, some codes are used…

@ignacioiglesias
Copy link

Something like this: 55ac07b

@marquete
Copy link
Owner

Hey, Nacho!

Supporting the meta key in a browser-agnostic manner would be awesome indeed. However, given the way I've chosen to do things, one problem that I note in your approach is that there would be multiple overwriting assignments to Kibo.KEY_CODES_BY_NAME.meta (see the way Kibo.KEY_CODES_BY_NAME is populated) and that would result in unwanted behaviour.

Thanks for your input!

@dana321
Copy link

dana321 commented Dec 31, 2017

I've also made a fork that uses cmd for firefox, then lcmd and rcmd for safari/chrome.

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

No branches or pull requests

4 participants