From 3c7c46e5846a39dde8be85c131e69cab1d8cb1ec Mon Sep 17 00:00:00 2001 From: "John F. Fay" Date: Mon, 4 Jan 2010 04:07:03 +0000 Subject: [PATCH] Implementing feature request 2824176: detection of X11 special keys: SHIFT, CTRL, ALT git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@867 7f0cb862-5218-0410-a997-914c9d46530a --- include/GL/freeglut_ext.h | 6 ++++++ src/freeglut_main.c | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/include/GL/freeglut_ext.h b/include/GL/freeglut_ext.h index aca85e7..2b9ad99 100644 --- a/include/GL/freeglut_ext.h +++ b/include/GL/freeglut_ext.h @@ -38,6 +38,12 @@ #define GLUT_KEY_NUM_LOCK 0x006D #define GLUT_KEY_BEGIN 0x006E #define GLUT_KEY_DELETE 0x006F +#define GLUT_KEY_SHIFT_L 0x0070 +#define GLUT_KEY_SHIFT_R 0x0071 +#define GLUT_KEY_CTRL_L 0x0072 +#define GLUT_KEY_CTRL_R 0x0073 +#define GLUT_KEY_ALT_L 0x0074 +#define GLUT_KEY_ALT_R 0x0075 /* * GLUT API Extension macro definitions -- behaviour when the user clicks on an "x" to close a window diff --git a/src/freeglut_main.c b/src/freeglut_main.c index 19f584e..3e6ad68 100644 --- a/src/freeglut_main.c +++ b/src/freeglut_main.c @@ -1387,6 +1387,13 @@ void FGAPIENTRY glutMainLoopEvent( void ) case XK_Num_Lock : special = GLUT_KEY_NUM_LOCK; break; case XK_KP_Begin : special = GLUT_KEY_BEGIN; break; case XK_KP_Delete: special = GLUT_KEY_DELETE; break; + + case XK_Shift_L: special = GLUT_KEY_SHIFT_L; break; + case XK_Shift_R: special = GLUT_KEY_SHIFT_R; break; + case XK_Control_L: special = GLUT_KEY_CTRL_L; break; + case XK_Control_R: special = GLUT_KEY_CTRL_R; break; + case XK_Alt_L: special = GLUT_KEY_ALT_L; break; + case XK_Alt_R: special = GLUT_KEY_ALT_R; break; } /* -- 1.7.10.4