handle shift-f10 and the menu key in tables on linux, since javafx only turns them into a context menu request on windows
What changed, and why it matters
This commit fixes a keyboard shortcut bug in Sparrow Wallet's transaction table on Linux. Previously, pressing Shift+F10 or the Menu key on Linux did not open the right-click-style row menu for the selected transaction row, even though it worked on Windows. The change makes those keys trigger the row menu on Linux too, while keeping an extra macOS-specific shortcut. It is a usability/accessibility fix, not a security vulnerability.
No security action required. Treat as a normal usability/accessibility fix.
Security signals we found
No security-relevant signals in the diff
Change is a platform-specific keyboard shortcut/UX fix
No input validation, cryptography, authentication, or privilege changes
Evidence from the diff
The patch broadens an existing key-event handler in CoinTreeTable from macOS-only to all non-Windows platforms. On Windows, JavaFX already converts Shift+F10/Menu key into a context-menu request; on Linux and macOS it does not. The handler now listens on Linux as well as macOS, and still adds Control+Return only for macOS. The result is that keyboard users on Linux can open the per-row context menu for the focused table row.
Changed components
src/main/java/com/sparrowwallet/sparrow/control/CoinTreeTable.javaInspect captured patch +4 / −3
### src/main/java/com/sparrowwallet/sparrow/control/CoinTreeTable.java
@@ -75,12 +75,13 @@ public Object queryAccessibleAttribute(AccessibleAttribute attribute, Object...
});
//Row actions are in the context menu of each row's entry cell, which a keyboard menu request to the table opens for the focused row.
- //Windows and Linux send Shift-F10 and the Menu key as that request; macOS sends nothing, so those keys and Control-Return are handled here.
+ //Only Windows sends Shift-F10 and the Menu key as that request; Linux and macOS send it only for a right click, so those keys are handled here.
+ //macOS keyboards have no Menu key, so Control-Return is also handled there.
boolean macOS = OsType.getCurrent() == OsType.MACOS;
- if(macOS) {
+ if(OsType.getCurrent() != OsType.WINDOWS) {
addEventHandler(KeyEvent.KEY_PRESSED, event -> {
boolean menuKey = event.getCode() == KeyCode.CONTEXT_MENU || (event.getCode() == KeyCode.F10 && event.isShiftDown())
- || (event.getCode() == KeyCode.ENTER && event.isControlDown() && !event.isShiftDown() && !event.isAltDown() && !event.isMetaDown());
+ || (macOS && event.getCode() == KeyCode.ENTER && event.isControlDown() && !event.isShiftDown() && !event.isAltDown() && !event.isMetaDown());
if(menuKey && event.getTarget() == this && showRowMenu(getFocusModel().getFocusedIndex())) {
event.consume();
}Why this scored 19/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.