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

Does not support hotkeys in another language #35

Closed
bondarvladislave opened this issue Jun 22, 2020 · 7 comments
Closed

Does not support hotkeys in another language #35

bondarvladislave opened this issue Jun 22, 2020 · 7 comments

Comments

@bondarvladislave
Copy link

bondarvladislave commented Jun 22, 2020

Does not support hotkeys when the keyboard is in another language

(e.key === 'a' && e.ctrlKey) || // Allow: Ctrl+A
(e.key === 'c' && e.ctrlKey) || // Allow: Ctrl+C
(e.key === 'v' && e.ctrlKey) || // Allow: Ctrl+V

I think the best way is to replace it with

(e.code === 'KeyA' && e.ctrlKey) || // Allow: Ctrl+A
(e.code === 'KeyC' && e.ctrlKey) || // Allow: Ctrl+C
(e.code === 'KeyV' && e.ctrlKey) || // Allow: Ctrl+V
@changhuixu
Copy link
Owner

changhuixu added a commit that referenced this issue Jul 7, 2020
@changhuixu
Copy link
Owner

@bondarvladislave

After I update the code, it doesn't work for IE...
So I have to pause this update a little bit.

@quinkk
Copy link

quinkk commented Aug 25, 2020

u no need to replace it just add OR condition

        (e.key === 'a' && e.ctrlKey === true) || // Allow: Ctrl+A
        (e.key === 'c' && e.ctrlKey === true) || // Allow: Ctrl+C
        (e.key === 'v' && e.ctrlKey === true) || // Allow: Ctrl+V
        (e.key === 'x' && e.ctrlKey === true) || // Allow: Ctrl+X
        (e.key === 'a' && e.metaKey === true) || // Allow: Cmd+A (Mac)
        (e.key === 'c' && e.metaKey === true) || // Allow: Cmd+C (Mac)
        (e.key === 'v' && e.metaKey === true) || // Allow: Cmd+V (Mac)
        (e.key === 'x' && e.metaKey === true) || // Allow: Cmd+X (Mac)
        (e.code === 'KeyA' && e.ctrlKey === true) || // Allow: Ctrl+A
        (e.code === 'KeyC' && e.ctrlKey === true) || // Allow: Ctrl+C
        (e.code === 'KeyV' && e.ctrlKey === true) // Allow: Ctrl+V

@changhuixu
Copy link
Owner

@quinkk I see, thank you.
I will try it out.

changhuixu added a commit that referenced this issue Aug 25, 2020
@changhuixu
Copy link
Owner

Hi @bondarvladislave and @quinkk ,

Could you try it out https://digit-only.firebaseapp.com/ to see if the app is working for your language keyboards now?
If it works, then I will release this change.

Thanks.

@bondarvladislave
Copy link
Author

@changhuixu thanks
Now everything works correctly on the Russian keyboard layout
And thanks @quinkk for the solution

@changhuixu
Copy link
Owner

Thank you. I released v2.2.0 just now.

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

3 participants