From 4ac78aa66fe9245eb38a1c9b8a7d94f8438bb4b8 Mon Sep 17 00:00:00 2001 From: joshuastray Date: Fri, 5 Sep 2014 18:33:41 +0800 Subject: [PATCH] fix the bug that delete doesn't work on desktop --- cocos/platform/desktop/CCGLView.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cocos/platform/desktop/CCGLView.cpp b/cocos/platform/desktop/CCGLView.cpp index 4c4fbd707221..42c8ae00fd0a 100644 --- a/cocos/platform/desktop/CCGLView.cpp +++ b/cocos/platform/desktop/CCGLView.cpp @@ -648,6 +648,11 @@ void GLView::onGLFWKeyCallback(GLFWwindow *window, int key, int scancode, int ac auto dispatcher = Director::getInstance()->getEventDispatcher(); dispatcher->dispatchEvent(&event); } + + if (GLFW_RELEASE != action && g_keyCodeMap[key] == EventKeyboard::KeyCode::KEY_BACKSPACE) + { + IMEDispatcher::sharedDispatcher()->dispatchDeleteBackward(); + } } void GLView::onGLFWCharCallback(GLFWwindow *window, unsigned int character)