public class AcceleratorHandler extends AbstractTool
Specifically, we want to handle key presses even if the current UI's built-in event handler would pass them up. For example, with the Swing UI, the menu infrastructure fires a menu item if the associated accelerator is pressed, but we need to fire the linked module regardless of which window is active; i.e., on Windows and Linux platforms, image windows do not have a menu bar attached, so the Swing menu infrastructure does not handle key presses when an image window is active.
This tool also handles the case where the accelerator lacks the platform's modifier key; e.g., if you press L (rather than Ctrl+L or Cmd+L) it will take care of launching the Command Finder plugin.
Constructor and Description |
---|
AcceleratorHandler() |
Modifier and Type | Method and Description |
---|---|
boolean |
isActiveInAppFrame() |
boolean |
isAlwaysActive() |
void |
onKeyDown(KyPressedEvent evt) |
getInfo, getPriority, setInfo, setPriority, toString
context, getContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
activate, configure, deactivate, getCursor, getDescription, onKeyUp, onMouseClick, onMouseDown, onMouseDrag, onMouseMove, onMouseUp, onMouseWheel
getIdentifier, log
context, getContext, setContext
compareTo, getPriority, setPriority
getInfo, setInfo
getLocation
getVersion
public boolean isAlwaysActive()
public boolean isActiveInAppFrame()
public void onKeyDown(KyPressedEvent evt)
Copyright © 2014–2022 ImageJ. All rights reserved.