Keydown event frequency
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.8k
- Forks
- 717
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 3
Description
Originally by @MTzukanov
Quote:
"The main problem is, that it's not possible to set a timout (or whatever) between several POST requests to the server-side.
So if a user holds down a shortcut key, e.g. ESC, each 2-3ms the server side will be informed with a POST request.
Example:
private final ShortcutListener escapseShortcutListener = new ShortcutListener("ESC key", KeyCode.ESCAPE, null)
{
private static final long serialVersionUID = -8080266529606949440L;
@Override
public void handleAction(Object sender, Object target)
{
// sample code will be called here,
// but should be not invoked for each 2-3ms
}
};
So we need a new behavior to react on keyUp/keyDown events inside the shortcut listener.
As long as the button is hold down, only one event should be triggered.
Is this possible in Vaadin?
(Worstcase scenario: If ~ 400-1000 user use shortcuts in an excesive way, the impact on the server-side would be our bottleneck in future.)"
Imported from https://dev.vaadin.com/ issue #12374
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing ShortcutListener and its handleAction callback, then inspect how keydown and keyup events are sent to the server. Confirm the intended behavior from the issue: holding a shortcut should trigger only one event rather than repeated POST requests. No file or test is named in the payload, so the relevant entry point and validation coverage must first be located.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100