示例#1
0
// 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.
    }
}
示例#2
0
  //------------------------------------------------------------------------------
  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
  }
示例#3
0
    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;
	}
示例#5
0
	void OGLApp::glfw_char(GLFWwindow *window, unsigned int x)
	{
		TwEventCharGLFW(x, GLFW_PRESS);
	}
示例#6
0
TW_API int TW_CDECL_CALL TwEventCharGLFWcdecl(int glfwChar, int glfwAction)
{
    return TwEventCharGLFW(glfwChar, glfwAction);
}
示例#7
0
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;
}
示例#9
0
文件: GUI.cpp 项目: Mahoimi/NbodySim
void TwEventCharGLFW3(GLFWwindow* window, int codepoint){TwEventCharGLFW(codepoint, GLFW_PRESS);}
void charInput(GLFWwindow* window, static unsigned int scanChar){
	if (TwEventCharGLFW(scanChar, GLFW_PRESS))
		return;
}
示例#11
0
void charCallback(GLFWwindow *window, unsigned int code_point) {
    int tweak = TwEventCharGLFW(code_point, GLFW_PRESS);
}