Fixed clipboard test OS X modifier.

This commit is contained in:
Camilla Berglund 2015-04-09 15:11:50 +02:00
parent 5b6e67119f
commit 9021e52a6f

View File

@ -34,6 +34,12 @@
#include "getopt.h" #include "getopt.h"
#if defined(__APPLE__)
#define MODIFIER GLFW_MOD_SUPER
#else
#define MODIFIER GLFW_MOD_CONTROL
#endif
static void usage(void) static void usage(void)
{ {
printf("Usage: clipboard [-h]\n"); printf("Usage: clipboard [-h]\n");
@ -56,7 +62,7 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action,
break; break;
case GLFW_KEY_V: case GLFW_KEY_V:
if (mods == GLFW_MOD_CONTROL) if (mods == MODIFIER)
{ {
const char* string; const char* string;
@ -69,7 +75,7 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action,
break; break;
case GLFW_KEY_C: case GLFW_KEY_C:
if (mods == GLFW_MOD_CONTROL) if (mods == MODIFIER)
{ {
const char* string = "Hello GLFW World!"; const char* string = "Hello GLFW World!";
glfwSetClipboardString(window, string); glfwSetClipboardString(window, string);