mirror of
https://github.com/glfw/glfw.git
synced 2026-09-17 14:22:50 +00:00
Added a conservative set of key modifiers.
This commit is contained in:
+2
-2
@@ -43,7 +43,7 @@
|
||||
void init( void );
|
||||
void display( void );
|
||||
void reshape( GLFWwindow* window, int w, int h );
|
||||
void key_callback( GLFWwindow* window, int key, int action );
|
||||
void key_callback( GLFWwindow* window, int key, int action, int mods );
|
||||
void DrawBoingBall( void );
|
||||
void BounceBall( double dt );
|
||||
void DrawBoingBallBand( GLfloat long_lo, GLfloat long_hi );
|
||||
@@ -245,7 +245,7 @@ void reshape( GLFWwindow* window, int w, int h )
|
||||
0.0, -1.0, 0.0 ); /* up vector */
|
||||
}
|
||||
|
||||
void key_callback( GLFWwindow* window, int key, int action )
|
||||
void key_callback( GLFWwindow* window, int key, int action, int mods )
|
||||
{
|
||||
if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
|
||||
glfwSetWindowShouldClose(window, GL_TRUE);
|
||||
|
||||
+2
-2
@@ -211,13 +211,13 @@ static void animate(void)
|
||||
|
||||
|
||||
/* change view angle, exit upon ESC */
|
||||
void key( GLFWwindow* window, int k, int action )
|
||||
void key( GLFWwindow* window, int k, int action, int mods )
|
||||
{
|
||||
if( action != GLFW_PRESS ) return;
|
||||
|
||||
switch (k) {
|
||||
case GLFW_KEY_Z:
|
||||
if( glfwGetKey( window, GLFW_KEY_LEFT_SHIFT ) )
|
||||
if( mods & GLFW_MOD_SHIFT )
|
||||
view_rotz -= 5.0;
|
||||
else
|
||||
view_rotz += 5.0;
|
||||
|
||||
@@ -477,7 +477,7 @@ static void update_mesh(void)
|
||||
* GLFW callback functions
|
||||
*********************************************************************/
|
||||
|
||||
static void key_callback(GLFWwindow* window, int key, int action)
|
||||
static void key_callback(GLFWwindow* window, int key, int action, int mods)
|
||||
{
|
||||
switch(key)
|
||||
{
|
||||
|
||||
@@ -414,7 +414,7 @@ static void cursorPosFun(GLFWwindow* window, double x, double y)
|
||||
// Mouse button callback function
|
||||
//========================================================================
|
||||
|
||||
static void mouseButtonFun(GLFWwindow* window, int button, int action)
|
||||
static void mouseButtonFun(GLFWwindow* window, int button, int action, int mods)
|
||||
{
|
||||
if ((button == GLFW_MOUSE_BUTTON_LEFT) && action == GLFW_PRESS)
|
||||
{
|
||||
@@ -434,7 +434,7 @@ static void mouseButtonFun(GLFWwindow* window, int button, int action)
|
||||
do_redraw = 1;
|
||||
}
|
||||
|
||||
static void key_callback(GLFWwindow* window, int key, int action)
|
||||
static void key_callback(GLFWwindow* window, int key, int action, int mods)
|
||||
{
|
||||
if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
|
||||
glfwSetWindowShouldClose(window, GL_TRUE);
|
||||
|
||||
+2
-2
@@ -270,7 +270,7 @@ static void error_callback(int error, const char* description)
|
||||
// Handle key strokes
|
||||
//========================================================================
|
||||
|
||||
void key_callback(GLFWwindow* window, int key, int action)
|
||||
void key_callback(GLFWwindow* window, int key, int action, int mods)
|
||||
{
|
||||
if (action != GLFW_PRESS)
|
||||
return;
|
||||
@@ -313,7 +313,7 @@ void key_callback(GLFWwindow* window, int key, int action)
|
||||
// Callback function for mouse button events
|
||||
//========================================================================
|
||||
|
||||
void mouse_button_callback(GLFWwindow* window, int button, int action)
|
||||
void mouse_button_callback(GLFWwindow* window, int button, int action, int mods)
|
||||
{
|
||||
if (button != GLFW_MOUSE_BUTTON_LEFT)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user