diff --git a/src/main/java/games/rednblack/editor/utils/KeyBindingsLayout.java b/src/main/java/games/rednblack/editor/utils/KeyBindingsLayout.java index e85524aa..a721fa34 100644 --- a/src/main/java/games/rednblack/editor/utils/KeyBindingsLayout.java +++ b/src/main/java/games/rednblack/editor/utils/KeyBindingsLayout.java @@ -98,7 +98,7 @@ public class KeyBindingsLayout { defaultMapper.put(ALIGN_BOTTOM, new KeyMapper(ALIGN_BOTTOM, true, false, false, Input.Keys.NUMPAD_2)); defaultMapper.put(ALIGN_RIGHT, new KeyMapper(ALIGN_RIGHT, true, false, false, Input.Keys.NUMPAD_6)); - defaultMapper.put(DELETE, new KeyMapper(DELETE, false, false, false, Input.Keys.DEL)); + defaultMapper.put(DELETE, new KeyMapper(DELETE, false, false, false, Input.Keys.DEL, Input.Keys.FORWARD_DEL)); defaultMapper.put(HIDE_GUI, new KeyMapper(HIDE_GUI, false, false, false, Input.Keys.F12)); defaultMapper.put(OPEN_CONSOLE, new KeyMapper(OPEN_CONSOLE, false, false, false, Input.Keys.F10)); diff --git a/src/main/java/games/rednblack/editor/view/stage/SandboxMediator.java b/src/main/java/games/rednblack/editor/view/stage/SandboxMediator.java index 9602980c..efd3fac5 100644 --- a/src/main/java/games/rednblack/editor/view/stage/SandboxMediator.java +++ b/src/main/java/games/rednblack/editor/view/stage/SandboxMediator.java @@ -347,16 +347,11 @@ public class SandboxMediator extends Mediator { public boolean keyUp(int entity, int keycode) { facade.sendNotification(MsgAPI.ACTION_KEY_UP, keycode); - Sandbox sandbox = Sandbox.getInstance(); switch (KeyBindingsLayout.mapAction(keycode)) { case KeyBindingsLayout.PAN_TOOL: // if pan mode is disabled set cursor back toolHotSwapBack(); break; - case KeyBindingsLayout.DELETE: - // delete selected item - sandbox.getSelector().removeCurrentSelectedItems(); - break; } if(currentSelectedTool != null) { diff --git a/src/main/java/games/rednblack/editor/view/stage/tools/PolygonTool.java b/src/main/java/games/rednblack/editor/view/stage/tools/PolygonTool.java index b06207a6..2c911fb9 100644 --- a/src/main/java/games/rednblack/editor/view/stage/tools/PolygonTool.java +++ b/src/main/java/games/rednblack/editor/view/stage/tools/PolygonTool.java @@ -26,6 +26,7 @@ import games.rednblack.editor.controller.commands.AddComponentToItemCommand; import games.rednblack.editor.controller.commands.RemoveComponentFromItemCommand; import games.rednblack.editor.controller.commands.component.UpdatePolygonVerticesCommand; import games.rednblack.editor.renderer.components.shape.PolygonShapeComponent; +import games.rednblack.editor.utils.KeyBindingsLayout; import games.rednblack.editor.utils.poly.PolygonUtils; import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.editor.view.stage.Sandbox; @@ -220,7 +221,7 @@ public class PolygonTool extends SelectionTool implements PolygonTransformationL @Override public void keyDown(int entity, int keycode) { - if(keycode == Input.Keys.DEL || keycode == Input.Keys.FORWARD_DEL) { + if(KeyBindingsLayout.mapAction(keycode) == KeyBindingsLayout.DELETE) { if(!deleteSelectedAnchor()) { super.keyDown(entity, keycode); } diff --git a/src/main/java/games/rednblack/editor/view/stage/tools/SelectionTool.java b/src/main/java/games/rednblack/editor/view/stage/tools/SelectionTool.java index eadf9269..54e243eb 100644 --- a/src/main/java/games/rednblack/editor/view/stage/tools/SelectionTool.java +++ b/src/main/java/games/rednblack/editor/view/stage/tools/SelectionTool.java @@ -475,7 +475,7 @@ public class SelectionTool extends SimpleTool { } // Delete - if (keycode == Input.Keys.DEL || keycode == Input.Keys.FORWARD_DEL) { + if (KeyBindingsLayout.mapAction(keycode) == KeyBindingsLayout.DELETE) { Facade.getInstance().sendNotification(MsgAPI.ACTION_DELETE); } }