Fix the keyboard up callback and a compiler warning.
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@64 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
parent
c6ce746e65
commit
449e4c1014
@ -1668,12 +1668,24 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
|
|||||||
*/
|
*/
|
||||||
if( window->Callbacks.KeyboardUp != NULL )
|
if( window->Callbacks.KeyboardUp != NULL )
|
||||||
window->Callbacks.KeyboardUp( 127, window->State.MouseX, window->State.MouseY );
|
window->Callbacks.KeyboardUp( 127, window->State.MouseX, window->State.MouseY );
|
||||||
|
|
||||||
|
break ;
|
||||||
default:
|
default:
|
||||||
|
{
|
||||||
/*
|
/*
|
||||||
* Call the KeyboardUp callback for a regular character if there is one.
|
* 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 )
|
if( window->Callbacks.KeyboardUp != NULL )
|
||||||
window->Callbacks.KeyboardUp( wParam, window->State.MouseX, window->State.MouseY );
|
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:
|
* 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
|
* Thrash the modifiers register now
|
||||||
|
Reference in New Issue
Block a user