mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-08-11 17:17:42 +03:00
Fix tab key-press not changing widget when a not main modifier is being used (for example enabling the numeric keyboard).
This commit is contained in:
@@ -20,7 +20,7 @@ class EE_API UIEventDispatcher : public EventDispatcher {
|
||||
|
||||
void inputCallback( InputEvent* Event );
|
||||
|
||||
void checkTabPress( const Uint32& KeyCode, const Uint32& mod );
|
||||
void checkTabPress( Uint32 KeyCode, Uint32 mod );
|
||||
};
|
||||
|
||||
}} // namespace EE::UI
|
||||
|
||||
@@ -19,6 +19,8 @@ class EE_API Input {
|
||||
|
||||
virtual ~Input();
|
||||
|
||||
static Uint32 sanitizeMod( const Uint32& mod );
|
||||
|
||||
/** Update the Input */
|
||||
virtual void update() = 0;
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include <eepp/ui/uieventdispatcher.hpp>
|
||||
#include <eepp/ui/uiscenenode.hpp>
|
||||
#include <eepp/ui/uiwidget.hpp>
|
||||
#include <eepp/window/input.hpp>
|
||||
#include <eepp/window/inputevent.hpp>
|
||||
#include <eepp/window/window.hpp>
|
||||
|
||||
@@ -10,8 +11,7 @@ UIEventDispatcher* UIEventDispatcher::New( SceneNode* sceneNode ) {
|
||||
return eeNew( UIEventDispatcher, ( sceneNode ) );
|
||||
}
|
||||
|
||||
UIEventDispatcher::UIEventDispatcher( SceneNode* sceneNode ) :
|
||||
EventDispatcher( sceneNode ) {}
|
||||
UIEventDispatcher::UIEventDispatcher( SceneNode* sceneNode ) : EventDispatcher( sceneNode ) {}
|
||||
|
||||
bool UIEventDispatcher::justGainedFocus() const {
|
||||
return mJustGainedFocus;
|
||||
@@ -45,9 +45,10 @@ void UIEventDispatcher::inputCallback( InputEvent* event ) {
|
||||
}
|
||||
}
|
||||
|
||||
void UIEventDispatcher::checkTabPress( const Uint32& KeyCode, const Uint32& mod ) {
|
||||
void UIEventDispatcher::checkTabPress( Uint32 KeyCode, Uint32 mod ) {
|
||||
eeASSERT( NULL != mFocusNode );
|
||||
if ( KeyCode == KEY_TAB ) {
|
||||
mod = Input::sanitizeMod( mod );
|
||||
Window::Window* win = mFocusNode->getSceneNode()->getWindow();
|
||||
if ( mFocusNode->isWidget() && NULL != win && !mJustGainedFocus ) {
|
||||
if ( mod & KEYMOD_SHIFT ) {
|
||||
|
||||
@@ -506,7 +506,7 @@ const Uint32& Input::getModState() const {
|
||||
return mInputMod;
|
||||
}
|
||||
|
||||
static Uint32 sanitizeMod( const Uint32& mod ) {
|
||||
Uint32 Input::sanitizeMod( const Uint32& mod ) {
|
||||
Uint32 smod = 0;
|
||||
if ( mod & KEYMOD_CTRL )
|
||||
smod |= KEYMOD_CTRL;
|
||||
|
||||
Reference in New Issue
Block a user