开发者

Handle key presses using draw2d and swt

开发者 https://www.devze.com 2023-01-19 01:56 出处:网络
Every org.eclipse.draw2d.Figureclass has addKeyListener() method. But when key presses not every Figure handle it. What k开发者_StackOverflowind of figure handles key-events?

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号