Code Monkey home page Code Monkey logo

Comments (6)

AhmetSBulbul avatar AhmetSBulbul commented on September 6, 2024 1
image

Using option key modifies the value of event.key, so instead of using option we can use control key or another solution is using code value instead of key. For example the code always will be Digit1 but the key can be "1" or "i" or something else, removing the Digit prefix will solve the issue but in searchable lists field is updated with the value instead of executing shortcut.

I'm gonna open PR with using control key solution.

I'm adding the "using event.code instead of key and clear the Digit prefix" solution here as a referance if anyone needs to use altKey for shortcut later.

image image

from visual-ts.

ozhanefemeral avatar ozhanefemeral commented on September 6, 2024

Hey @AhmetSBulbul πŸ‘‹

Thank you for the heads up.

Isn't CTRL key used for switching tabs on Windows devices? CTRL + 1-9 key combination is reserved for this purpose as far as I know.

Maybe we use CTRL for Mac and Alt on Windows, or use the other solution you offered. That would be great if you can test that behavior on Windows or open a branch/draft PR for me to test

Cheers

from visual-ts.

AhmetSBulbul avatar AhmetSBulbul commented on September 6, 2024

Okay, right now it's optional, both of them are working. I updated the PR as a draft. If we don't have more complex use case I'm gonna just create new Component to show the right key according to OS. I don't have a windows setup to test right now but I haven't changed the logic, I just added a "or" statement so it must be working as expected. But if you have a chance to test you can let me know if there is an any problem.

from visual-ts.

ozhanefemeral avatar ozhanefemeral commented on September 6, 2024

Let's keep this branch only for fixing the bug.

That would be great if you can create a new issue for showing the right key enhancement if you have time. I can also create the issue next week. we can implement showing the right key with:

  1. using/creating a custom hook for getting OS details, and call that in KeyCombinationLabel
  2. add a util function, and call that in KeyCombinationLabel
  3. Or other ways?

and here is how you can change User Agent from Chrome Dev Tools:
https://developer.chrome.com/docs/devtools/device-mode/override-user-agent

So you can change Firefox/Opera/Chrome and Mac/Windows while workingπŸ‘

from visual-ts.

AhmetSBulbul avatar AhmetSBulbul commented on September 6, 2024

Thanks for the trick. I'm gonna create an issue as soon as possible. If you have a chance to open before me, you can mention me in the comment.

from visual-ts.

ozhanefemeral avatar ozhanefemeral commented on September 6, 2024

Closing this issue as completed thanks to PR by @AhmetSBulbul πŸ’ͺ

from visual-ts.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.