LearnNewsExamplesServices
Frontmatter
id21
titleDiscussion: KeyNav -> boost the onKeyDown trigger speed
stateClosed
labels
enhancementdiscussionstale
assignees[]
createdAtNov 17, 2019, 5:33 PM
updatedAtSep 29, 2024, 4:39 AM
githubUrlhttps://github.com/neomjs/neo/issues/21
authortobiu
commentsCount2
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtSep 29, 2024, 4:39 AM

Discussion: KeyNav -> boost the onKeyDown trigger speed

Closed v7.9.1/archive-v7-9-1-chunk-1 enhancementdiscussionstale
tobiu
tobiu commented on Nov 17, 2019, 5:33 PM

I am thinking about an optional flag for the keyNav. Especially when navigating through the helix items using the arrow keys, it feels like you move 5 / 300 items per second. The reason seems to be that the keydown event does not fire more often in case you keep a key pressed.

My current idea: save the last x onKeyDown events (key & timestamp). In case the same key triggers x times within the time interval y, fire the event handler again with a delay. E.g. the app worker gets the event every 200ms, fire it again with a 100ms delay. If it keeps firing "longer", add 3 delayed handler calls (50, 100, 150ms). OnKeyUp should cancel all timeout calls to stop at the current position.

We could further polish this in case we keep track of the current FPS rate and ensure there is max 1 movement within 1 animation frame (follow up ticket).

Thoughts?

tobiu added the enhancement label on Nov 17, 2019, 5:33 PM
tobiu added the discussion label on Nov 17, 2019, 5:34 PM