[Plib-cvs] plib/src/pw pwWindows.cxx,1.12,1.13
Brought to you by:
sjbaker
From: James J. <pu...@us...> - 2004-08-05 00:55:43
|
Update of /cvsroot/plib/plib/src/pw In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17799 Modified Files: pwWindows.cxx Log Message: This implements the key auto-repeat in Windows to be the same as it is in X11. (John Fay) Index: pwWindows.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pw/pwWindows.cxx,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- pwWindows.cxx 9 Apr 2004 00:05:19 -0000 1.12 +++ pwWindows.cxx 5 Aug 2004 00:55:32 -0000 1.13 @@ -121,7 +121,20 @@ case WM_KEYDOWN: /* If the key is already down, we are on auto-repeat. Break if the autorepeat is disabled. */ - if ( ( updown == PW_DOWN ) && ( int(wParam) == old_key ) && !autoRepeat ) break ; + if ( ( updown == PW_DOWN ) && ( int(wParam) == old_key ) ) + { + if ( autoRepeat ) + { + /* Disable CTRL, SHIFT, CapsLock keys from making a callback */ + if ( ( key == VK_CONTROL ) || ( key == VK_SHIFT ) || ( key == VK_CAPITAL ) ) + break ; + + if ( key != -1 && kbCB ) // Autorepeat enabled, call the callback with an "up" setting + (*kbCB) ( key, PW_UP, lastx, lasty ) ; + } + else + break ; // Autorepeat not enabled, just break + } updown = PW_DOWN ; old_key = wParam ; @@ -202,7 +215,6 @@ autoRepeat = enable ; } - void pwSetCallbacks ( pwKeybdFunc *kb, pwMouseFunc *ms, pwMousePosFunc *mp, pwResizeCB *rcb, pwExitCB *ecb ) { @@ -226,6 +238,8 @@ } +//typedef const char * wglGetExtensionsStringARBtype ( HDC hdc ) ; + void pwInit ( int x, int y, int w, int h, int multisample, char *title, int border, int num_samples ) { @@ -294,6 +308,14 @@ exit ( 1 ) ; } +// wglGetExtensionsStringARBtype *wglGetExtensionsStringARB = (wglGetExtensionsStringARBtype *)wglGetProcAddress ( "wglGetExtensionsStringARB" ) ; +// const char *extensionsString = wglGetExtensionsStringARB ( currDC ) ; + +// printf ( "%s %x %s\n", glGetString ( GL_EXTENSIONS ), wglGetExtensionsStringARB, extensionsString ) ; + +// if (!GLExtensionExists("WGL_ARB_multisample ")) +// return suggestedFormat; + /* Set pixel format for DC */ PIXELFORMATDESCRIPTOR pfd = { sizeof(PIXELFORMATDESCRIPTOR), /* size of this pfd */ |