Skip to content

Commit

Permalink
fix InputEvent in fairyGUI onKeyDown and onKeyUp (#1757)
Browse files Browse the repository at this point in the history
  • Loading branch information
binxiaojiao authored Mar 17, 2024
1 parent 6caa3f8 commit 3b8d8d9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion extensions/fairygui/src/fairygui/event/InputProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,10 @@ void InputProcessor::onKeyDown(ax::EventKeyboard::KeyCode keyCode, ax::Event * e

_recentInput._keyCode = keyCode;
_recentInput._target = _owner;
_recentInput._target->dispatchEvent(UIEventType::KeyDown);

_activeProcessor = this; // add by binxiaojiao
_recentInput._target->dispatchEvent(UIEventType::KeyDown);
_activeProcessor = nullptr; // add by binxiaojiao
}

void InputProcessor::onKeyUp(ax::EventKeyboard::KeyCode keyCode, ax::Event *)
Expand All @@ -713,7 +716,10 @@ void InputProcessor::onKeyUp(ax::EventKeyboard::KeyCode keyCode, ax::Event *)

_recentInput._keyCode = keyCode;
_recentInput._target = _owner;

_activeProcessor = this; // add by binxiaojiao
_recentInput._target->dispatchEvent(UIEventType::KeyUp);
_activeProcessor = nullptr; // add by binxiaojiao
}

TouchInfo::TouchInfo() :
Expand Down

0 comments on commit 3b8d8d9

Please sign in to comment.