update(); // Do an update if collided with at least *one* object in the document
if (toolAction)
+ {
+ if (Object::snapToGrid)
+ point = Object::SnapPointToGrid(point);
+
toolAction->MouseDown(point);
+ }
// Didn't hit any object and not using a tool, so do a selection rectangle
if (!(collided || toolAction))
}
}
+
+void DrawingView::keyPressEvent(QKeyEvent * event)
+{
+ if (toolAction)
+ {
+ bool needUpdate = toolAction->KeyDown(event->key());
+
+ if (needUpdate)
+ update();
+ }
+}
+
+
+void DrawingView::keyReleaseEvent(QKeyEvent * event)
+{
+ if (toolAction)
+ {
+ bool needUpdate = toolAction->KeyReleased(event->key());
+
+ if (needUpdate)
+ update();
+ }
+}
+