Changeset 2689 for trunk/src/opengl/glut/win32_winproc.c
- Timestamp:
- Feb 9, 2000, 9:51:20 AM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/opengl/glut/win32_winproc.c
r2595 r2689 1 1 /* $Id: win32_winproc.c,v 1.2 2000-02-09 08:46:23 jeroen Exp $ */ 2 2 /* Copyright (c) Nate Robins, 1997. */ 3 3 /* portions Copyright (c) Mark Kilgard, 1997, 1998. */ … … 10 10 #include "glutint.h" 11 11 #if defined(__WIN32OS2__) 12 #include "wgl.h" 12 13 #include <ctype.h> 13 14 #endif … … 59 60 LPMINMAXINFO minmax; /* Minimum/maximum info structure. */ 60 61 GLUTwindow* window; /* GLUT window associated with message. */ 61 GLUTmenu* menu; /* GLUT menu associated with message.*/62 GLUTmenu* menu; /* GLUT menu associated with message.*/ 62 63 int x, y, width, height, key; 63 64 int button = -1; 65 int fSendKeyStroke=1; 64 66 65 67 switch(msg) { … … 69 71 PostQuitMessage(0); 70 72 return 0; 71 #if 073 #if defined(__WIN32OS2__) 72 74 case WM_DESTROY: 73 75 /* XXX NVidia's NT OpenGL can have problems closing down … … 88 90 #endif 89 91 case WM_PAINT: 92 dprintf(("GLUT32: WM_PAINT processing...\n")); 90 93 window = __glutGetWindow(hwnd); 91 94 if (window) { 92 BeginPaint(hwnd, &ps); /* Must have this for some Win32 reason. */ 95 #ifndef __WIN32OS2__ 96 BeginPaint(hwnd, &ps); /* Must have this for some Win32 reason.*/ 93 97 EndPaint(hwnd, &ps); 98 #endif 94 99 if (window->win == hwnd) { 95 100 __glutPostRedisplay(window, GLUT_REPAIR_WORK); … … 211 216 __glutSetWindow(window); 212 217 __glutModifierMask = 0; 213 if (GetKeyState(VK_SHIFT) < 0) /* < 0 = high order bit is on*/218 if (GetKeyState(VK_SHIFT) < 0) /* < 0 = high order bit is on*/ 214 219 __glutModifierMask |= ShiftMask; 215 220 if (GetKeyState(VK_CONTROL) < 0) … … 293 298 __glutSetWindow(window); 294 299 __glutModifierMask = 0; 295 if (GetKeyState(VK_SHIFT) < 0) /* < 0 = high order bit is on*/300 if (GetKeyState(VK_SHIFT) < 0) /* < 0 = high order bit is on*/ 296 301 __glutModifierMask |= ShiftMask; 297 302 if (GetKeyState(VK_CONTROL) < 0) … … 304 309 /* Specially handle any keys that match ASCII values but 305 310 do not generate Windows WM_SYSCHAR or WM_CHAR messages. */ 311 306 312 switch (wParam) { 307 313 case VK_DELETE: 308 314 handleDelete: 309 315 /* Delete is an ASCII character. */ 310 GetCursorPos(&point); 311 ScreenToClient(window->win, &point); 312 __glutSetWindow(window); 313 __glutModifierMask = 0; 314 if (GetKeyState(VK_SHIFT) < 0) /* < 0 = high order bit is on */ 315 __glutModifierMask |= ShiftMask; 316 if (GetKeyState(VK_CONTROL) < 0) 317 __glutModifierMask |= ControlMask; 318 if (GetKeyState(VK_MENU) < 0) 319 __glutModifierMask |= Mod1Mask; 320 window->keyboard((unsigned char) 127, point.x, point.y); 321 __glutModifierMask = (unsigned int) ~0; 322 return 0; 316 dprintf(("VK_DELETE - wParam is %d\n",wParam)); 317 key=(unsigned char)127; 318 break; 319 320 #ifdef __WIN32OS2__ 321 /* For some reason Odin doesn't generate WM_CHARS for 'special' keys */ 322 /* at least - none that are received here. Create 'em here!! */ 323 case VK_F1: 324 case VK_F2: 325 case VK_F3: 326 case VK_F4: 327 case VK_F5: 328 case VK_F6: 329 case VK_F7: 330 case VK_F8: 331 case VK_F9: 332 case VK_F10: 333 case VK_F11: 334 case VK_F12: 335 case VK_LEFT: 336 case VK_UP: 337 case VK_RIGHT: 338 case VK_DOWN: 339 case VK_PRIOR: 340 case VK_NEXT: 341 case VK_HOME: 342 case VK_END: 343 case VK_INSERT: 344 case VK_ESCAPE: 345 key=wParam; 346 break; 347 #endif 348 323 349 default: 324 350 /* Let the following WM_SYSCHAR or WM_CHAR message generate 325 351 the keyboard callback. */ 352 fSendKeyStroke=0; 326 353 break; 327 354 } 355 356 if(fSendKeyStroke) 357 { 358 dprintf(("Sending keystroke %d...\n",key)); 359 360 GetCursorPos(&point); 361 ScreenToClient(window->win, &point); 362 __glutSetWindow(window); 363 __glutModifierMask = 0; 364 if (GetKeyState(VK_SHIFT) < 0) /* < 0 = high order bit is on*/ 365 __glutModifierMask |= ShiftMask; 366 if (GetKeyState(VK_CONTROL) < 0) 367 __glutModifierMask |= ControlMask; 368 if (GetKeyState(VK_MENU) < 0) 369 __glutModifierMask |= Mod1Mask; 370 window->keyboard(key, point.x, point.y); 371 __glutModifierMask = (unsigned int) ~0; 372 373 return 0; 374 } 328 375 } 329 376 return 0; … … 566 613 567 614 case WM_SIZE: 615 dprintf(("GLUT32: Handling WM_SIZE...")); 568 616 window = __glutGetWindow(hwnd); 569 617 if (window) { … … 586 634 /* A reshape should be considered like posting a 587 635 repair request. */ 636 dprintf(("GLUT32: WM_SIZE processing -> GLUT_REPAIR_WORK\n")); 588 637 __glutPostRedisplay(window, GLUT_REPAIR_WORK); 589 638 } 590 639 } 640 dprintf(("GLUT32: Handled WM_SIZE...")); 591 641 return 0; 592 642
Note:
See TracChangeset
for help on using the changeset viewer.