Comments (8)
The solution (#4) is to keep track of keys that are currently pressed and reset combo
when no keys are pressed down.
Published to NPM in v0.3.1
from svelte-keydown.
@metonym Why can't you handle it normally?
Creating an additional variable spoils all the transparency of the solution.
from svelte-keydown.
@lukaszpolowczyk Can you submit a PR with your preferred solution?
from svelte-keydown.
@metonym It turns out that I just can't install version 0.3.1
There is 0.3.0 in npm: https://www.npmjs.com/package/svelte-keydown
In the previous comment, I thought the reason was different. Sorry.
It works fine here:
https://metonym.github.io/svelte-keydown/#on%3Acombo
Looks like you just need to update the npm database.
from svelte-keydown.
@lukaszpolowczyk No problem – try installing 0.3.1 now from npm
from svelte-keydown.
@metonym It's better, but there is still some bug.
Steps:
- Press and hold Shift
- At the same time, I press ArrowRight
- I release ArrowRight
- Press ArrowRight
- I release ArrowRight
So despite releasing ArrowLeft
, it is still saved in combining.
The bug is because I'm holding Shift.
from svelte-keydown.
So your expected behavior would be to preserve the Shift
key but not ArrowRight
/ArrowLeft
after releasing?
from svelte-keydown.
@metonym I want this effect:
Because I am holding the Shift
button but releasing the ArrowRight/ArrowLeft
button.
If (holding Shift
) I let go of ArrowRight
and then hit ArrowLeft
, then ArrowRight
should disappear from the latest combination.
I have two separate shortcuts:
Shift-ArrowRight
Shift-ArrowLeft
And they call separate functions that I alternate without letting go of Shift
because that would be inconvenient and unintuitive.
from svelte-keydown.
Related Issues (6)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from svelte-keydown.