mirror of https://github.com/axmolengine/axmol.git
Trigger onKeyReleased only after the key has been released
This commit is contained in:
parent
f560b11c75
commit
ffad18a1ed
|
@ -256,7 +256,7 @@ void EGLViewEventHandler::OnGLFWMouseScrollCallback(GLFWwindow* window, double x
|
|||
|
||||
void EGLViewEventHandler::OnGLFWKeyCallback(GLFWwindow *window, int key, int scancode, int action, int mods)
|
||||
{
|
||||
EventKeyboard event(g_keyCodeMap[key], GLFW_PRESS == action);
|
||||
EventKeyboard event(g_keyCodeMap[key], GLFW_PRESS == action || GLFW_REPEAT == action);
|
||||
auto dispatcher = Director::getInstance()->getEventDispatcher();
|
||||
dispatcher->dispatchEvent(&event);
|
||||
}
|
||||
|
|
|
@ -274,7 +274,7 @@ void EGLViewEventHandler::OnGLFWMouseScrollCallback(GLFWwindow* window, double x
|
|||
|
||||
void EGLViewEventHandler::OnGLFWKeyCallback(GLFWwindow *window, int key, int scancode, int action, int mods)
|
||||
{
|
||||
EventKeyboard event(g_keyCodeMap[key], GLFW_PRESS == action);
|
||||
EventKeyboard event(g_keyCodeMap[key], GLFW_PRESS == action || GLFW_REPEAT == action);
|
||||
auto dispatcher = Director::getInstance()->getEventDispatcher();
|
||||
dispatcher->dispatchEvent(&event);
|
||||
}
|
||||
|
|
|
@ -373,7 +373,7 @@ void EGLViewEventHandler::OnGLFWMouseScrollCallback(GLFWwindow* window, double x
|
|||
|
||||
void EGLViewEventHandler::OnGLFWKeyCallback(GLFWwindow *window, int key, int scancode, int action, int mods)
|
||||
{
|
||||
EventKeyboard event(g_keyCodeMap[key], GLFW_PRESS == action);
|
||||
EventKeyboard event(g_keyCodeMap[key], GLFW_PRESS == action || GLFW_REPEAT == action);
|
||||
auto dispatcher = Director::getInstance()->getEventDispatcher();
|
||||
dispatcher->dispatchEvent(&event);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue