From e27b8a5739cc5e6fe7e77875f705be60ca828d8f Mon Sep 17 00:00:00 2001 From: Maselbas Date: Thu, 14 May 2015 19:02:35 +0200 Subject: [PATCH] SDK SceneComposer : bugfix in the ShortcutManager, prevent from setting the currentShorcut to NULL when there are no new activable shortcuts --- .../tools/shortcuts/ShortcutManager.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/tools/shortcuts/ShortcutManager.java b/sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/tools/shortcuts/ShortcutManager.java index 38548087d..5dad38d7c 100644 --- a/sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/tools/shortcuts/ShortcutManager.java +++ b/sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/tools/shortcuts/ShortcutManager.java @@ -66,8 +66,11 @@ public class ShortcutManager { } public boolean activateShortcut(KeyInputEvent kie) { - currentShortcut = getActivableShortcut(kie); - return isActive(); + ShortcutTool newShortcut = getActivableShortcut(kie); + if(newShortcut != null){ + currentShortcut = newShortcut; + } + return newShortcut != null; } public void doKeyPressed(KeyInputEvent kie) { @@ -182,13 +185,13 @@ public class ShortcutManager { public static boolean checkAxisKey(KeyInputEvent kie, Vector3f axisStore) { if (kie.getKeyCode() == KeyInput.KEY_X) { - axisStore = Vector3f.UNIT_X; + axisStore.set(Vector3f.UNIT_X); return true; } else if (kie.getKeyCode() == KeyInput.KEY_Y) { - axisStore = Vector3f.UNIT_Y; + axisStore.set(Vector3f.UNIT_Y); return true; } else if (kie.getKeyCode() == KeyInput.KEY_Z) { - axisStore = Vector3f.UNIT_Z; + axisStore.set(Vector3f.UNIT_Z); return true; } return false;