Removing some errant tabs, fixing ticket #2137721, and adding special-key capability...
authorJohn F. Fay <johnffay@nettally.com>
Tue, 3 Feb 2009 21:08:11 +0000 (21:08 +0000)
committerJohn F. Fay <johnffay@nettally.com>
Tue, 3 Feb 2009 21:08:11 +0000 (21:08 +0000)
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@764 7f0cb862-5218-0410-a997-914c9d46530a

include/GL/freeglut_ext.h
src/freeglut_main.c

index 7dae3e9..27c6f06 100644 (file)
 #endif
 
 /*
+ * Additional GLUT Key definitions for the Special key function
+ */
+#define GLUT_KEY_NUM_LOCK           0x006D
+#define GLUT_KEY_BEGIN              0x006E
+#define GLUT_KEY_DELETE             0x006F
+
+/*
  * GLUT API Extension macro definitions -- behaviour when the user clicks on an "x" to close a window
  */
 #define GLUT_ACTION_EXIT                         0
index e47bd8a..dd83de8 100644 (file)
@@ -1159,15 +1159,15 @@ void FGAPIENTRY glutMainLoopEvent( void )
              * XXX track ButtonPress/ButtonRelease events in our own
              * XXX bit-mask?
              */
-           fgState.Modifiers = fghGetXModifiers( event.xmotion.state );
+            fgState.Modifiers = fghGetXModifiers( event.xmotion.state );
             if ( event.xmotion.state & ( Button1Mask | Button2Mask | Button3Mask | Button4Mask | Button5Mask ) ) {
                 INVOKE_WCB( *window, Motion, ( event.xmotion.x,
                                                event.xmotion.y ) );
             } else {
                 INVOKE_WCB( *window, Passive, ( event.xmotion.x,
                                                 event.xmotion.y ) );
-           }
-           fgState.Modifiers = INVALID_MODIFIERS;
+            }
+            fgState.Modifiers = INVALID_MODIFIERS;
         }
         break;
 
@@ -1356,9 +1356,13 @@ void FGAPIENTRY glutMainLoopEvent( void )
                     case XK_F11:    special = GLUT_KEY_F11;    break;
                     case XK_F12:    special = GLUT_KEY_F12;    break;
 
+                    case XK_KP_Left:
                     case XK_Left:   special = GLUT_KEY_LEFT;   break;
+                    case XK_KP_Right:
                     case XK_Right:  special = GLUT_KEY_RIGHT;  break;
+                    case XK_KP_Up:
                     case XK_Up:     special = GLUT_KEY_UP;     break;
+                    case XK_KP_Down:
                     case XK_Down:   special = GLUT_KEY_DOWN;   break;
 
                     case XK_KP_Prior:
@@ -1371,6 +1375,10 @@ void FGAPIENTRY glutMainLoopEvent( void )
                     case XK_End:    special = GLUT_KEY_END;    break;
                     case XK_KP_Insert:
                     case XK_Insert: special = GLUT_KEY_INSERT; break;
+
+                    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;
                     }
 
                     /*