diff --git a/src/game/GameController.cpp b/src/game/GameController.cpp index 3408ec541..7b7ba20d3 100644 --- a/src/game/GameController.cpp +++ b/src/game/GameController.cpp @@ -97,6 +97,8 @@ public: { cc->gameModel->SetStamp(cc->stamps->GetStamp()); } + else + cc->gameModel->SetStamp(NULL); } }; diff --git a/src/game/GameView.cpp b/src/game/GameView.cpp index c7dc06358..4067d5a29 100644 --- a/src/game/GameView.cpp +++ b/src/game/GameView.cpp @@ -717,6 +717,10 @@ void GameView::OnKeyRelease(int key, Uint16 character, bool shift, bool ctrl, bo void GameView::OnTick(float dt) { + if(selectMode==PlaceStamp && !stampThumb) + selectMode = SelectNone; + if(selectMode==PlaceClipboard&& !clipboardThumb) + selectMode = SelectNone; if(zoomEnabled && !zoomCursorFixed) c->SetZoomPosition(currentMouse); if(drawMode == DrawPoints) diff --git a/src/interface/Keys.h b/src/interface/Keys.h index 5350b065c..71c592815 100644 --- a/src/interface/Keys.h +++ b/src/interface/Keys.h @@ -9,6 +9,7 @@ #define KEY_TAB SDLK_TAB #define KEY_RETURN SDLK_RETURN #define KEY_ENTER SDLK_KP_ENTER +#define KEY_ESCAPE SDLK_ESCAPE #define KEY_CTRL SDLK_LCTRL #define KEY_ALT SDLK_LALT diff --git a/src/search/SearchView.cpp b/src/search/SearchView.cpp index 5bcbe065e..4b9b6b2f5 100644 --- a/src/search/SearchView.cpp +++ b/src/search/SearchView.cpp @@ -241,3 +241,19 @@ void SearchView::OnTick(float dt) { c->Update(); } + +void SearchView::OnMouseWheel(int x, int y, int d) +{ + if(!d) + return; + if(d<0) + c->NextPage(); + else + c->PrevPage(); +} +void SearchView::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool alt) +{ + if(key==KEY_ESCAPE) + c->Exit(); +} + diff --git a/src/search/SearchView.h b/src/search/SearchView.h index 01034198e..af43a8c0a 100644 --- a/src/search/SearchView.h +++ b/src/search/SearchView.h @@ -37,6 +37,9 @@ public: virtual ~SearchView(); void AttachController(SearchController * _c) { c = _c; } virtual void OnTick(float dt); + virtual void OnMouseWheel(int x, int y, int d); + virtual void OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool alt); + }; #endif // SEARCHVIEW_H diff --git a/src/stamps/StampsView.cpp b/src/stamps/StampsView.cpp index bddfb4f7c..c0d5981e0 100644 --- a/src/stamps/StampsView.cpp +++ b/src/stamps/StampsView.cpp @@ -133,6 +133,21 @@ void StampsView::NotifyStampsListChanged(StampsModel * sender) } } +void StampsView::OnMouseWheel(int x, int y, int d) +{ + if(!d) + return; + if(d<0) + c->NextPage(); + else + c->PrevPage(); +} +void StampsView::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool alt) +{ + if(key==KEY_ESCAPE) + c->Exit(); +} + StampsView::~StampsView() { // TODO Auto-generated destructor stub } diff --git a/src/stamps/StampsView.h b/src/stamps/StampsView.h index a906cdc4c..02e556996 100644 --- a/src/stamps/StampsView.h +++ b/src/stamps/StampsView.h @@ -29,6 +29,8 @@ public: void AttachController(StampsController * c_) { c = c_; }; void NotifyPageChanged(StampsModel * sender); void NotifyStampsListChanged(StampsModel * sender); + virtual void OnMouseWheel(int x, int y, int d); + virtual void OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool alt); virtual ~StampsView(); };