From 4670eb7805234cf98561b38440589fe3f1d0f460 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Mon, 23 Feb 2015 15:34:32 -0500 Subject: [PATCH] Allow use of arrow keys to scroll the terrain area in the scenario editor --- src/scenedit/scen.actions.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/scenedit/scen.actions.cpp b/src/scenedit/scen.actions.cpp index 3f9cadc5..3adabd68 100644 --- a/src/scenedit/scen.actions.cpp +++ b/src/scenedit/scen.actions.cpp @@ -1332,6 +1332,7 @@ void handle_keystroke(sf::Event event) { using Key = sf::Keyboard::Key; Key keypad[10] = {kb::Numpad0,kb::Numpad1,kb::Numpad2,kb::Numpad3,kb::Numpad4,kb::Numpad5,kb::Numpad6,kb::Numpad7,kb::Numpad8,kb::Numpad9}; + Key arrows[4] = {kb::Down, kb::Left, kb::Right, kb::Up}; // TODO: The repetition of location shouldn't be needed here! location terrain_click[10] = {location{0,0}, // 0 location{6,356}, location{140,356}, location{270,356}, @@ -1350,7 +1351,7 @@ void handle_keystroke(sf::Event event) { return; for(i = 0; i < 10; i++) - if(chr2 == keypad[i]) { + if(chr2 == keypad[i] || (i % 2 == 0 && i > 0 && chr2 == arrows[i / 2 - 1])) { if(i == 0) { chr = 'z'; }