Skip to content

Commit 9954eb5

Browse files
fix console completion selection on HTML5 (#3225)
* fix completion selection on HTML revert formatting * remove trailing whitespace * Update flixel/system/debug/console/Console.hx --------- Co-authored-by: George Kurelic <[email protected]>
1 parent a52272d commit 9954eb5

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

flixel/system/debug/completion/CompletionList.hx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ class CompletionList extends Sprite
3737
createPopupEntries(capacity);
3838
createScrollBar();
3939
updateSelectedItem();
40-
41-
FlxG.stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
4240
}
4341

4442
public function show(x:Float, items:Array<String>)
@@ -82,7 +80,7 @@ class CompletionList extends Sprite
8280
addChild(scrollBar);
8381
}
8482

85-
function onKeyDown(e:KeyboardEvent)
83+
public function onKeyDown(e:KeyboardEvent)
8684
{
8785
if (!visible)
8886
return;

flixel/system/debug/console/Console.hx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,11 @@ class Console extends Window
196196
function onKeyDown(e:KeyboardEvent)
197197
{
198198
if (completionList.visible)
199+
{
200+
// Fixes issue with listening for key down events - https://github.com/HaxeFlixel/flixel/pull/3225
201+
completionList.onKeyDown(e);
199202
return;
203+
}
200204

201205
switch (e.keyCode)
202206
{

0 commit comments

Comments
 (0)