Changeset 10430 in vbox
- Timestamp:
- Jul 9, 2008 2:20:37 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 33090
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp
r8834 r10430 163 163 static int gHostKeySym2 = SDLK_UNKNOWN; 164 164 #endif 165 static char *gHostKeyDisabledCombinations; 165 166 static BOOL gfGrabbed = FALSE; 166 167 static BOOL gfGrabOnMouseClick = TRUE; … … 645 646 " -nofstoggle Forbid switching to/from fullscreen mode\n" 646 647 " -noresize Make the SDL frame non resizable\n" 647 " -nohostkey Disable hostkey\n" 648 " -nohostkey Disable all hostkey combinations\n" 649 " -nohostkeys ... Disable specific hostkey combinations, see below for valid keys\n" 648 650 " -nograbonclick Disable mouse/keyboard grabbing on mouse click w/o additions\n" 649 651 " -detecthostkey Get the hostkey identifier and modifier state\n" … … 1291 1293 gHostKeyMod = 0; 1292 1294 gHostKeySym1 = 0; 1295 } 1296 else if (strcmp(argv[curArg], "-nohostkeys") == 0) 1297 { 1298 if (++curArg >= argc) 1299 { 1300 RTPrintf("Error: missing a string of disabled hostkey combinations\n"); 1301 rc = E_FAIL; 1302 break; 1303 } 1304 gHostKeyDisabledCombinations = argv[curArg]; 1305 unsigned i, cStr = strlen(gHostKeyDisabledCombinations); 1306 for (i=0; i<cStr; i++) 1307 { 1308 if (!strchr("fhnpqrs", gHostKeyDisabledCombinations[i])) 1309 { 1310 RTPrintf("Error: <hostkey> + '%c' is not a valid combination\n", 1311 gHostKeyDisabledCombinations[i]); 1312 rc = E_FAIL; 1313 i = cStr; 1314 break; 1315 } 1316 } 1293 1317 } 1294 1318 else if (strcmp(argv[curArg], "-nograbonclick") == 0) … … 4487 4511 case SDLK_f: 4488 4512 { 4489 if (gfAllowFullscreenToggle) 4490 { 4491 /* 4492 * We have to pause/resume the machine during this 4493 * process because there might be a short moment 4494 * without a valid framebuffer 4495 */ 4496 MachineState_T machineState; 4497 gMachine->COMGETTER(State)(&machineState); 4498 if (machineState == MachineState_Running) 4499 gConsole->Pause(); 4500 gpFrameBuffer->setFullscreen(!gpFrameBuffer->getFullscreen()); 4501 if (machineState == MachineState_Running) 4502 gConsole->Resume(); 4503 4504 /* 4505 * We have switched from/to fullscreen, so request a full 4506 * screen repaint, just to be sure. 4507 */ 4508 gDisplay->InvalidateAndUpdate(); 4509 } 4513 if ( strchr(gHostKeyDisabledCombinations, 'f') 4514 || !gfAllowFullscreenToggle) 4515 return VERR_NOT_SUPPORTED; 4516 4517 /* 4518 * We have to pause/resume the machine during this 4519 * process because there might be a short moment 4520 * without a valid framebuffer 4521 */ 4522 MachineState_T machineState; 4523 gMachine->COMGETTER(State)(&machineState); 4524 if (machineState == MachineState_Running) 4525 gConsole->Pause(); 4526 gpFrameBuffer->setFullscreen(!gpFrameBuffer->getFullscreen()); 4527 if (machineState == MachineState_Running) 4528 gConsole->Resume(); 4529 4530 /* 4531 * We have switched from/to fullscreen, so request a full 4532 * screen repaint, just to be sure. 4533 */ 4534 gDisplay->InvalidateAndUpdate(); 4510 4535 break; 4511 4536 } … … 4516 4541 case SDLK_p: 4517 4542 { 4543 if (strchr(gHostKeyDisabledCombinations, 'p')) 4544 return VERR_NOT_SUPPORTED; 4545 4518 4546 MachineState_T machineState; 4519 4547 gMachine->COMGETTER(State)(&machineState); … … 4537 4565 case SDLK_r: 4538 4566 { 4567 if (strchr(gHostKeyDisabledCombinations, 'r')) 4568 return VERR_NOT_SUPPORTED; 4569 4539 4570 ResetVM(); 4540 4571 break; … … 4546 4577 case SDLK_q: 4547 4578 { 4579 if (strchr(gHostKeyDisabledCombinations, 'q')) 4580 return VERR_NOT_SUPPORTED; 4581 4548 4582 return VINF_EM_TERMINATE; 4549 break;4550 4583 } 4551 4584 … … 4555 4588 case SDLK_s: 4556 4589 { 4590 if (strchr(gHostKeyDisabledCombinations, 's')) 4591 return VERR_NOT_SUPPORTED; 4592 4557 4593 SaveState(); 4558 4594 return VINF_EM_TERMINATE; … … 4561 4597 case SDLK_h: 4562 4598 { 4599 if (strchr(gHostKeyDisabledCombinations, 'h')) 4600 return VERR_NOT_SUPPORTED; 4601 4563 4602 if (gConsole) 4564 4603 gConsole->PowerButton(); … … 4571 4610 case SDLK_n: 4572 4611 { 4612 if (strchr(gHostKeyDisabledCombinations, 'n')) 4613 return VERR_NOT_SUPPORTED; 4614 4573 4615 RTThreadYield(); 4574 4616 ULONG cSnapshots = 0;
Note:
See TracChangeset
for help on using the changeset viewer.