* Parse keyboard commands and execute accordingly. */
| 445 | * Parse keyboard commands and execute accordingly. |
| 446 | */ |
| 447 | static void KeyboardCommands (void) |
| 448 | { |
| 449 | int is_shift, is_alt; |
| 450 | |
| 451 | // get the keyboard input |
| 452 | |
| 453 | // check if the family keyboard is enabled |
| 454 | if (CurInputType[2] == SIFC_FKB) |
| 455 | { |
| 456 | if ( g_keyState[SDL_SCANCODE_SCROLLLOCK] ) |
| 457 | { |
| 458 | g_fkbEnabled ^= 1; |
| 459 | FCEUI_DispMessage ("Family Keyboard %sabled.", 0, |
| 460 | g_fkbEnabled ? "en" : "dis"); |
| 461 | } |
| 462 | if (g_fkbEnabled) |
| 463 | { |
| 464 | return; |
| 465 | } |
| 466 | } |
| 467 | |
| 468 | if (g_keyState[SDL_SCANCODE_LSHIFT] || g_keyState[SDL_SCANCODE_RSHIFT]) |
| 469 | { |
| 470 | is_shift = 1; |
| 471 | } |
| 472 | else |
| 473 | { |
| 474 | is_shift = 0; |
| 475 | } |
| 476 | |
| 477 | if (g_keyState[SDL_SCANCODE_LALT] || g_keyState[SDL_SCANCODE_RALT]) |
| 478 | { |
| 479 | is_alt = 1; |
| 480 | } |
| 481 | else |
| 482 | { |
| 483 | is_alt = 0; |
| 484 | } |
| 485 | |
| 486 | |
| 487 | if (_keyonly (Hotkeys[HK_TOGGLE_BG])) |
| 488 | { |
| 489 | if (is_shift) |
| 490 | { |
| 491 | FCEUI_SetRenderPlanes (true, false); |
| 492 | } |
| 493 | else |
| 494 | { |
| 495 | FCEUI_SetRenderPlanes (true, true); |
| 496 | } |
| 497 | } |
| 498 | |
| 499 | // Alt-Enter to toggle full-screen |
| 500 | // This is already handled by GTK Accelerator |
| 501 | //if (keyonly (ENTER) && is_alt) |
| 502 | //{ |
| 503 | // ToggleFS (); |
| 504 | //} |
no test coverage detected