Hi, sry it's me again with this annoying issue :(

Can anybody help me with a good snippet to register Keys as JOSM plugin, 
please?

I'm not sure if it is a problem cause I haven't got the focus as layer 
or if I use the wrong techniques.

I tried:
Main.panel.addKeyListener(this);
Main.map.mapView.addKeyListener(this);
Main.map.mapView.getRootPane().getGlassPane().addKeyListener(this);
and of course the InputMap approach:
Main.contentPane.getInputMap().put(KeyStroke.getKeyStroke("SPACE"),"pressed");
Main.contentPane.getActionMap().put("pressed",a);
Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_SPACE,0),a);
Main.contentPane.getActionMap().put("doSomething",a);

Sry but I'm realy annoyed cause I can't realise such a cheap feature :-(

nice weekeend
Matthias

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

Reply via email to