Skip to content

Commit

Permalink
fix: implement previous fix correctly using FocusEvent (I was using t…
Browse files Browse the repository at this point in the history
…he wrong event type before)
  • Loading branch information
Notexe committed Mar 17, 2024
1 parent c8bf2a5 commit e470af9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
Binary file modified content/chunk0/scaleform/001598DB8D4DC9DB.GFXF
Binary file not shown.
Binary file modified source/bin/SimpleKeyEventHelper.swf
Binary file not shown.
11 changes: 9 additions & 2 deletions source/src/simplekeyeventhelper/SimpleKeyEventHelper.as
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package simplekeyeventhelper {
import common.BaseControl;

import flash.events.Event;
import flash.events.FocusEvent;
import flash.events.KeyboardEvent;
import flash.ui.Keyboard;
import flash.utils.describeType;
Expand All @@ -17,7 +18,8 @@ public class SimpleKeyEventHelper extends BaseControl {

public function SimpleKeyEventHelper() {
addEventListener(Event.ADDED_TO_STAGE, onAdded);
addEventListener(Event.REMOVED_FROM_STAGE, onRemoved);
addEventListener(FocusEvent.FOCUS_IN, onFocusIn);
addEventListener(FocusEvent.FOCUS_OUT, onFocusOut);
}

public function onSetData(object:Object):void {
Expand All @@ -32,11 +34,16 @@ public class SimpleKeyEventHelper extends BaseControl {
private function onAdded(event:Event):void {
if (m_enabled) {
addKeyListeners();
}
}

private function onFocusIn(event:FocusEvent):void {
if (m_enabled) {
Send_onFocusAdded();
}
}

private function onRemoved(event:Event):void {
private function onFocusOut(event:FocusEvent):void {
if (m_enabled) {
Send_onFocusRemoved();
}
Expand Down

0 comments on commit e470af9

Please sign in to comment.