@@ -0,0 +1,899 @@
+%0Apackage imagej.core.tools.global;%0A%0Aimport imagej.ImageJ;%0Aimport imagej.ext.display.event.input.KyPressedEvent;%0Aimport imagej.ext.module.ModuleInfo;%0Aimport imagej.ext.module.ModuleService;%0Aimport imagej.ext.tool.AbstractTool;%0Aimport imagej.ext.tool.Tool;%0Aimport imagej.util.Log;%0A%0A@Tool(name = %22Keyboard Shortcuts%22, global = true, priority = Integer.MIN_VALUE)%0Apublic class AcceleratorHandler extends AbstractTool %7B%0A%0A%09private final ModuleService moduleService;%0A%0A%09public AcceleratorHandler() %7B%0A%09%09moduleService = ImageJ.get(ModuleService.class);%0A%09%7D%0A%0A%09@Override%0A%09public boolean onKeyDown(final KyPressedEvent evt) %7B%0A%09%09// TODO: enquire the OptionService whether the Control modifier should be%0A%09%09// forced%0A%09%09final ModuleInfo moduleInfo =%0A%09%09%09moduleService.getModuleForAccelerator(evt.getAcceleratorString(true));%0A%09%09if (moduleInfo == null) return false;%0A%09%09moduleService.run(moduleInfo);%0A%09%09return true;%0A%09%7D%0A%7D%0A

Add a global tool that handles accelerators in image windows