diff --git a/flixel/system/debug/completion/CompletionList.hx b/flixel/system/debug/completion/CompletionList.hx index 6afa57c2ac..2406f10dbf 100644 --- a/flixel/system/debug/completion/CompletionList.hx +++ b/flixel/system/debug/completion/CompletionList.hx @@ -37,8 +37,6 @@ class CompletionList extends Sprite createPopupEntries(capacity); createScrollBar(); updateSelectedItem(); - - FlxG.stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown); } public function show(x:Float, items:Array) @@ -82,7 +80,7 @@ class CompletionList extends Sprite addChild(scrollBar); } - function onKeyDown(e:KeyboardEvent) + public function onKeyDown(e:KeyboardEvent) { if (!visible) return; diff --git a/flixel/system/debug/console/Console.hx b/flixel/system/debug/console/Console.hx index ec567331de..638e543b84 100644 --- a/flixel/system/debug/console/Console.hx +++ b/flixel/system/debug/console/Console.hx @@ -196,7 +196,11 @@ class Console extends Window function onKeyDown(e:KeyboardEvent) { if (completionList.visible) + { + // Fixes issue with listening for key down events - https://github.com/HaxeFlixel/flixel/pull/3225 + completionList.onKeyDown(e); return; + } switch (e.keyCode) {