X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=freeglut-1.3%2Ffreeglut_main.c;h=1c11f0d30801079b6250992b6fe770684b6414df;hb=d0ce50a0da001bb3f076bab3d0adcc639ed40b5f;hp=20a5304ef5377859ce093c5726948317e0ce7d1c;hpb=405b6e87c164e61550cc4c0af7fc2f07b9f07043;p=freeglut diff --git a/freeglut-1.3/freeglut_main.c b/freeglut-1.3/freeglut_main.c index 20a5304..1c11f0d 100644 --- a/freeglut-1.3/freeglut_main.c +++ b/freeglut-1.3/freeglut_main.c @@ -447,7 +447,7 @@ static void fgCleanUpGlutsMess( void ) /* -- INTERFACE FUNCTIONS -------------------------------------------------- */ /* - * Executes a single iteration in the FreeGLUT processing loop. + * Executes a single iteration in the freeglut processing loop. */ void FGAPIENTRY glutMainLoopEvent( void ) { @@ -1051,7 +1051,7 @@ void FGAPIENTRY glutMainLoopEvent( void ) } /* - * Enters the FreeGLUT processing loop. Stays until the "ExecState" changes to "GLUT_EXEC_STATE_STOP". + * Enters the freeglut processing loop. Stays until the "ExecState" changes to "GLUT_EXEC_STATE_STOP". */ void FGAPIENTRY glutMainLoop( void ) { @@ -1126,7 +1126,7 @@ void FGAPIENTRY glutMainLoop( void ) } /* - * Leaves the FreeGLUT processing loop. + * Leaves the freeglut processing loop. */ void FGAPIENTRY glutLeaveMainLoop( void ) { @@ -1668,12 +1668,24 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara */ if( window->Callbacks.KeyboardUp != NULL ) window->Callbacks.KeyboardUp( 127, window->State.MouseX, window->State.MouseY ); + + break ; default: - /* - * Call the KeyboardUp callback for a regular character if there is one. - */ - if( window->Callbacks.KeyboardUp != NULL ) - window->Callbacks.KeyboardUp( wParam, window->State.MouseX, window->State.MouseY ); + { + /* + * Call the KeyboardUp callback for a regular character if there is one. + */ + BYTE state[ 256 ]; + WORD code[ 2 ]; + + GetKeyboardState(state); + + if ( ToAscii( wParam, 0, state, code, 0 ) == 1 ) + wParam=code[ 0 ]; + + if( window->Callbacks.KeyboardUp != NULL ) + window->Callbacks.KeyboardUp( (char)wParam, window->State.MouseX, window->State.MouseY ); + } } /* @@ -1719,7 +1731,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara /* * Have the special callback executed: */ - window->Callbacks.Keyboard( wParam, window->State.MouseX, window->State.MouseY ); + window->Callbacks.Keyboard( (char)wParam, window->State.MouseX, window->State.MouseY ); /* * Thrash the modifiers register now