// Callback function called by GLFW on char event void GLFWCALL OnChar(int glfwChar, int glfwAction) { if( !TwEventCharGLFW(glfwChar, glfwAction) ) // Send event to AntTweakBar { // Event has not been handled by AntTweakBar // Do something if needed. } }
//------------------------------------------------------------------------------ void MyWindow::keyboardchar(unsigned char key, int mods, int x, int y) { WindowInertiaCamera::keyboardchar(key, mods, x, y); #ifdef USEANTTWEAKBAR //int res = TwEventKeyboardGLUT(key, x,y); TwEventMousePosGLFW(x,y); int res = TwEventCharGLFW(key, BUTTON_PRESS|mods); if(res) { postRedisplay(); return; } #endif }
void GLFW_App::s_charFunc(GLFWwindow* window, unsigned int key) { GLFW_App* app = static_cast<GLFW_App*>(glfwGetWindowUserPointer(window)); if(app->displayTweakBar()) TwEventCharGLFW(key, GLFW_PRESS); if(key == GLFW_KEY_SPACE){return;} uint32_t buttonMod, keyMod; s_getModifiers(window, buttonMod, keyMod); // KeyEvent e(0, key, keyMod); // app->keyPress(e); }
////////////////////////////////////////////////////////////////////////// // Input Events void DebugUIKeyPress(int key, int state) { switch(key) { case GLFW_KEY_ENTER: key = TW_KEY_RETURN; break; case GLFW_KEY_BACKSPACE: key = TW_KEY_BACKSPACE; break; } TwEventKeyGLFW(key, state); TwEventCharGLFW(key, state); TW_KEY_RETURN; }
void OGLApp::glfw_char(GLFWwindow *window, unsigned int x) { TwEventCharGLFW(x, GLFW_PRESS); }
TW_API int TW_CDECL_CALL TwEventCharGLFWcdecl(int glfwChar, int glfwAction) { return TwEventCharGLFW(glfwChar, glfwAction); }
void myTwEventCharGLFW(GLFWwindow* window, unsigned int character) { TwEventCharGLFW((int)character, GLFW_PRESS);//GLFW_KEY_DOWN); // Is this correct?? }
static void onCharCallback(GLFWwindow* window, unsigned int codepoint) { // AntTweakBar event if (TwEventCharGLFW(codepoint, GLFW_PRESS)) return; }
void TwEventCharGLFW3(GLFWwindow* window, int codepoint){TwEventCharGLFW(codepoint, GLFW_PRESS);}
void charInput(GLFWwindow* window, static unsigned int scanChar){ if (TwEventCharGLFW(scanChar, GLFW_PRESS)) return; }
void charCallback(GLFWwindow *window, unsigned int code_point) { int tweak = TwEventCharGLFW(code_point, GLFW_PRESS); }