Allow intercepting keyboard events

This will be needed by ImageJ2's LegacyUI to install commands with
accelerators, e.g. the script editor.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>