Index: /applications/editors/josm/plugins/touchscreenhelper/build.xml
===================================================================
--- /applications/editors/josm/plugins/touchscreenhelper/build.xml	(revision 29257)
+++ /applications/editors/josm/plugins/touchscreenhelper/build.xml	(revision 29258)
@@ -30,5 +30,5 @@
 <project name="touchscreenhelper" default="dist" basedir=".">
     <!-- enter the SVN commit message -->
-    <property name="commit.message" value="Commit message"/>
+    <property name="commit.message" value="JOSM/touchscreenhelper: Added T shortcut, hold T to activate temporarily"/>
     <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
     <property name="plugin.main.version" value="4394"/>
@@ -37,5 +37,5 @@
     <property name="plugin.src.dir" value="src"/>
     <property name="plugin.dist.dir" value="../../dist"/>
-    <property name="ant.build.javac.target" value="1.5"/>
+    <property name="ant.build.javac.target" value="1.6"/>
     <property name="plugin.dist.dir" value="../../dist"/>
     <property name="plugin.jar" value="${plugin.dist.dir}/${ant.project.name}.jar"/>
Index: /applications/editors/josm/plugins/touchscreenhelper/src/touchscreenhelper/BrowseAction.java
===================================================================
--- /applications/editors/josm/plugins/touchscreenhelper/src/touchscreenhelper/BrowseAction.java	(revision 29257)
+++ /applications/editors/josm/plugins/touchscreenhelper/src/touchscreenhelper/BrowseAction.java	(revision 29258)
@@ -4,4 +4,5 @@
 
 import java.awt.Cursor;
+import java.awt.event.KeyEvent;
 import java.awt.event.MouseEvent;
 import java.awt.event.MouseListener;
@@ -12,18 +13,40 @@
 import org.openstreetmap.josm.gui.MapFrame;
 import org.openstreetmap.josm.data.coor.EastNorth;
+import org.openstreetmap.josm.tools.Shortcut;
+import uitils.TimedKeyReleaseListener;
 
 public class BrowseAction extends MapMode implements MouseListener,
-    MouseMotionListener {
+    MouseMotionListener, MapFrame.MapModeChangeListener {
+
+    private MapMode oldMapMode;
+    private TimedKeyReleaseListener listener;
 
     public BrowseAction(MapFrame mapFrame) {
         super(tr("Browse"), "browse", tr("Browse map with left button"),
+            Shortcut.registerShortcut("touchscreenhelper:browse", tr("Mode: {0}", tr("Browse map with left button")),
+                KeyEvent.VK_T, Shortcut.DIRECT),
             mapFrame, Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR));
+        MapFrame.addMapModeChangeListener(this);
     }
-
+    
+    @Override
+    public void mapModeChange(MapMode oldMapMode, MapMode newMapMode) {
+        this.oldMapMode = oldMapMode;
+    }
+    
     @Override public void enterMode() {
         super.enterMode();
-
         Main.map.mapView.addMouseListener(this);
         Main.map.mapView.addMouseMotionListener(this);
+
+        listener = new TimedKeyReleaseListener() {
+            @Override
+            protected void doKeyReleaseEvent(KeyEvent evt) {
+                if (evt.getKeyCode() == getShortcut().getKeyStroke().getKeyCode()) {
+                    if (oldMapMode!=null && !(oldMapMode instanceof BrowseAction))
+                    Main.map.selectMapMode(oldMapMode);
+                }
+            }
+        };
     }
 
@@ -33,4 +56,5 @@
         Main.map.mapView.removeMouseListener(this);
         Main.map.mapView.removeMouseMotionListener(this);
+        listener.stop();
     }
 
Index: /applications/editors/josm/plugins/touchscreenhelper/src/utils/TimedKeyReleaseListener.java
===================================================================
--- /applications/editors/josm/plugins/touchscreenhelper/src/utils/TimedKeyReleaseListener.java	(revision 29258)
+++ /applications/editors/josm/plugins/touchscreenhelper/src/utils/TimedKeyReleaseListener.java	(revision 29258)
@@ -0,0 +1,74 @@
+package utils;
+
+// Thanks to http://www.arco.in-berlin.de/keyevent.html
+// (code simplified here)
+
+
+import java.awt.AWTEvent;
+import java.awt.Toolkit;
+import java.awt.event.AWTEventListener;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.KeyEvent;
+import java.util.TreeSet;
+import javax.swing.Timer;
+
+public class TimedKeyReleaseListener implements AWTEventListener {
+    private final TreeSet<Integer> set = new TreeSet<Integer>();
+    private Timer timer;
+    protected KeyEvent releaseEvent;
+    
+    public TimedKeyReleaseListener() {
+        timer = new Timer(0, new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent ae) {
+                 timer.stop();
+                 if (set.remove(releaseEvent.getKeyCode())) {
+                  doKeyReleaseEvent(releaseEvent);
+                 }
+            }
+        });
+        
+        try {
+            Toolkit.getDefaultToolkit().addAWTEventListener(this,
+                    AWTEvent.KEY_EVENT_MASK);
+        } catch (SecurityException ex) {
+        }
+    }
+    @Override
+    public void eventDispatched(AWTEvent event) {
+        if (!(event instanceof KeyEvent)) return;
+        KeyEvent e = (KeyEvent) event;
+        if (event.getID() == KeyEvent.KEY_PRESSED) {
+            if (timer.isRunning()) {
+                timer.stop();
+            } else {
+                if (set.add((e.getKeyCode()))) doKeyPressEvent((KeyEvent) event);
+            }
+        }
+        if (event.getID() == KeyEvent.KEY_RELEASED) {
+            if (timer.isRunning()) {
+                timer.stop();
+                if (set.remove(e.getKeyCode())) doKeyReleaseEvent(e);
+            } else {
+                releaseEvent = e;
+                timer.restart();
+            }
+        }
+    }
+    
+
+    public void stop() {
+        try {
+            Toolkit.getDefaultToolkit().removeAWTEventListener(this);
+        } catch (SecurityException ex) {
+        }
+    }
+
+    
+    protected void doKeyReleaseEvent(KeyEvent evt) {
+    }
+
+    protected void doKeyPressEvent(KeyEvent evt) {
+    }
+}
