Matthias Meißer wrote:
> Sorry folks for my newbie questions but I doesn't get a working solution 
> to get callbacks if somebody presses the cursor keys in the main window.
> 
> main.parent.addkeyeventlistener(this); doesn't work, too :(
> 
> Is there some kind of Input map or does I have to use another approach 
> like creating an own JOSM mode?
> 
> Matthias

It's done countless times in JOSM source code. The direct approach would be
 
Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT,0),
 
actionname);

Aren't you computer science student? ;)


Sebastian

_______________________________________________
josm-dev mailing list
josm-dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/josm-dev

Reply via email to