diff --git a/flixel/system/debug/console/Console.hx b/flixel/system/debug/console/Console.hx index 638e543b84..0a01140ed8 100644 --- a/flixel/system/debug/console/Console.hx +++ b/flixel/system/debug/console/Console.hx @@ -218,6 +218,24 @@ class Console extends Window if (!history.isEmpty) setText(history.getPreviousCommand()); + #if html5 + // FlxKeyboard.preventDefaultKeys adds "preventDefault" on HTML5 + // so it ends up not fully propegating our inputs to the stage/event listeners + // we do this small work around so we don't need to mess around with lime/openfl events + // todo: support the modifier keys + case Keyboard.RIGHT: + if (FlxG.keys.preventDefaultKeys.contains(Keyboard.RIGHT)) + { + @:privateAccess + input.window_onKeyDown(RIGHT, 0); + } + case Keyboard.LEFT: + if (FlxG.keys.preventDefaultKeys.contains(Keyboard.LEFT)) + { + @:privateAccess + input.window_onKeyDown(LEFT, 0); + } + #end case Keyboard.DOWN: if (!history.isEmpty) setText(history.getNextCommand());