Hi everyone, I am using merkaartor on my laptop without a mouse. To have more convenience using merkaartor I have added some more keyboard shortcuts. * Plus-Key zooms in * Minus-Key zooms out * Arrow keys move the map
Please apply this patch to the repository. Thanks Rainer
diff -ru merkaartor.orig/merkaartor/MainWindow.cpp merkaartor/MainWindow.cpp
--- merkaartor.orig/merkaartor/MainWindow.cpp 2008-03-24 16:14:21.000000000 +0100
+++ merkaartor/MainWindow.cpp 2008-06-06 18:02:53.000000000 +0200
@@ -66,6 +66,10 @@
theDocument = new MapDocument(theLayers);
theView->setDocument(theDocument);
+ addAction(viewMoveLeftAction);
+ addAction(viewMoveRightAction);
+ addAction(viewMoveUpAction);
+ addAction(viewMoveDownAction);
theDocument->history().setActions(editUndoAction, editRedoAction);
theProperties = new PropertiesDock(this);
@@ -372,6 +376,34 @@
invalidateView();
}
+void MainWindow::on_viewMoveLeftAction_triggered()
+{
+ QPoint p(theView->rect().width()/4,0);
+ theView->projection().panScreen(p, theView->rect());
+ invalidateView();
+}
+void MainWindow::on_viewMoveRightAction_triggered()
+{
+ QPoint p(-theView->rect().width()/4,0);
+ theView->projection().panScreen(p, theView->rect());
+ invalidateView();
+}
+
+void MainWindow::on_viewMoveUpAction_triggered()
+{
+ QPoint p(0,theView->rect().height()/4);
+ theView->projection().panScreen(p, theView->rect());
+ invalidateView();
+}
+
+void MainWindow::on_viewMoveDownAction_triggered()
+{
+ QPoint p(0,-theView->rect().height()/4);
+ theView->projection().panScreen(p, theView->rect());
+ invalidateView();
+}
+
+
void MainWindow::on_viewZoomWindowAction_triggered()
{
theView->launch(new ZoomInteraction(theView));
diff -ru merkaartor.orig/merkaartor/MainWindow.h merkaartor/MainWindow.h
--- merkaartor.orig/merkaartor/MainWindow.h 2008-03-22 20:02:30.000000000 +0100
+++ merkaartor/MainWindow.h 2008-06-06 17:35:35.000000000 +0200
@@ -42,6 +42,10 @@
virtual void on_viewZoomInAction_triggered();
virtual void on_viewZoomOutAction_triggered();
virtual void on_viewZoomWindowAction_triggered();
+ virtual void on_viewMoveLeftAction_triggered();
+ virtual void on_viewMoveRightAction_triggered();
+ virtual void on_viewMoveUpAction_triggered();
+ virtual void on_viewMoveDownAction_triggered();
virtual void on_viewSetCoordinatesAction_triggered();
virtual void on_editRemoveAction_triggered();
virtual void on_editMoveAction_triggered();
diff -ru merkaartor.orig/merkaartor/MainWindow.ui merkaartor/MainWindow.ui
--- merkaartor.orig/merkaartor/MainWindow.ui 2008-03-24 15:28:11.000000000 +0100
+++ merkaartor/MainWindow.ui 2008-06-08 18:48:44.000000000 +0200
@@ -206,6 +206,9 @@
<property name="text" >
<string>Zoom &out</string>
</property>
+ <property name="shortcut" >
+ <string>-</string>
+ </property>
</action>
<action name="viewZoomInAction" >
<property name="text" >
@@ -217,6 +220,9 @@
<property name="toolTip" >
<string>Zoom in</string>
</property>
+ <property name="shortcut" >
+ <string>+</string>
+ </property>
</action>
<action name="createWayAction" >
<property name="text" >
@@ -478,6 +484,50 @@
<string>&Remove...</string>
</property>
</action>
+ <action name="viewMoveLeftAction" >
+ <property name="text" >
+ <string>MoveLeft</string>
+ </property>
+ <property name="shortcut" >
+ <string>Left</string>
+ </property>
+ <property name="shortcutContext" >
+ <enum>Qt::WindowShortcut</enum>
+ </property>
+ </action>
+ <action name="viewMoveRightAction" >
+ <property name="text" >
+ <string>viewMoveRight</string>
+ </property>
+ <property name="shortcut" >
+ <string>Right</string>
+ </property>
+ <property name="shortcutContext" >
+ <enum>Qt::WindowShortcut</enum>
+ </property>
+ </action>
+ <action name="viewMoveUpAction" >
+ <property name="text" >
+ <string>viewMoveUp</string>
+ </property>
+ <property name="shortcut" >
+ <string>Up</string>
+ </property>
+ <property name="shortcutContext" >
+ <enum>Qt::WindowShortcut</enum>
+ </property>
+ </action>
+ <action name="viewMoveDownAction" >
+ <property name="text" >
+ <string>viewMoveDown</string>
+ </property>
+ <property name="shortcut" >
+ <string>Down</string>
+ </property>
+ <property name="shortcutContext" >
+ <enum>Qt::WindowShortcut</enum>
+ </property>
+ </action>
</widget>
<resources>
<include location="Icons/AllIcons.qrc" />
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Merkaartor mailing list [email protected] http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/merkaartor
