Same Shortcut for multiple Components is not possible
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.8k
- Forks
- 717
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 3
Description
When adding the same Shortcut-KeyCode to multiple Components its not possible to trigger the ShortcutActions individually e.g when the Component is focused.
When pressing the Shortcut only the ShortcutAction that was registered first is executed.
textfield.addShortcutListener(new ShortcutListener("textfieldShortcut", ShortcutAction.KeyCode.SPACEBAR, null)
{
@Override
public void handleAction(Object pO, Object pO1)
{
System.out.println("textfield shortcut");
}
});
grid.addShortcutListener(new ShortcutListener("gridShortcut", ShortcutAction.KeyCode.SPACEBAR, null)
{
@Override
public void handleAction(Object pO, Object pO1)
{
System.out.println("grid shortcut");
}
});
In the example Code above only the Textfield ShortcutAction is executed regardless of which Component is focused.
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 reproducing the example with two components registering SPACEBAR ShortcutListeners, then trace how shortcut listeners are registered and selected for the focused component. Done means the focused component's ShortcutAction runs instead of always running the listener registered first.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100