1
0
Fork 0
mirror of https://github.com/gwm17/glfw.git synced 2024-11-23 02:38:52 -05:00

Add touch input toggling to events test

This commit is contained in:
Camilla Berglund 2012-04-18 12:45:01 +02:00
parent 036d70cdb8
commit b3e015d212

View File

@ -50,6 +50,7 @@ typedef struct
GLFWwindow* window; GLFWwindow* window;
int number; int number;
int closeable; int closeable;
int touch;
} Slot; } Slot;
static void usage(void) static void usage(void)
@ -372,6 +373,15 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action,
switch (key) switch (key)
{ {
case GLFW_KEY_T:
{
slot->touch = !slot->touch;
glfwSetInputMode(window, GLFW_TOUCH, slot->touch);
printf("(( touch %s ))\n", slot->touch ? "enabled" : "disabled");
break;
}
case GLFW_KEY_C: case GLFW_KEY_C:
{ {
slot->closeable = !slot->closeable; slot->closeable = !slot->closeable;
@ -526,6 +536,7 @@ int main(int argc, char** argv)
char title[128]; char title[128];
slots[i].closeable = GLFW_TRUE; slots[i].closeable = GLFW_TRUE;
slots[i].touch = GLFW_FALSE;
slots[i].number = i + 1; slots[i].number = i + 1;
sprintf(title, "Event Linter (Window %i)", slots[i].number); sprintf(title, "Event Linter (Window %i)", slots[i].number);