Handle key presses using draw2d and swt
Every org.eclipse.draw2d.Figure class has addKeyListener() method. But when key presses not every Figure handle it. What k开发者_StackOverflowind of figure handles key-events?
Thanks.
Hm. I don't know real answer. But as variant - add listener to Shell and handle it in some specific way.
The answer is "whichever Figure currently has focus." - otherwise every time you pressed a key, all of your figures would receive the KeyEvent
and have to handle it. I'd suggest that's unlikely to be what you want.
精彩评论