From b3e015d212354231441b4bbb106bc734d56440ea Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Wed, 18 Apr 2012 12:45:01 +0200 Subject: [PATCH] Add touch input toggling to events test --- tests/events.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/events.c b/tests/events.c index e63606bc..bf7fe962 100644 --- a/tests/events.c +++ b/tests/events.c @@ -50,6 +50,7 @@ typedef struct GLFWwindow* window; int number; int closeable; + int touch; } Slot; static void usage(void) @@ -372,6 +373,15 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action, 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: { slot->closeable = !slot->closeable; @@ -526,6 +536,7 @@ int main(int argc, char** argv) char title[128]; slots[i].closeable = GLFW_TRUE; + slots[i].touch = GLFW_FALSE; slots[i].number = i + 1; sprintf(title, "Event Linter (Window %i)", slots[i].number);