MCPcopy Create free account
hub / github.com/TASEmulators/fceux / KeyboardCommands

Function KeyboardCommands

src/drivers/sdl/input.cpp:447–865  ·  view source on GitHub ↗

* Parse keyboard commands and execute accordingly. */

Source from the content-addressed store, hash-verified

445 * Parse keyboard commands and execute accordingly.
446 */
447static 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 //}

Callers 1

FCEUD_UpdateInputFunction · 0.70

Calls 15

FCEUI_SetRenderPlanesFunction · 0.85
toggleMenuVisFunction · 0.85
FCEUI_FDSSelectFunction · 0.85
FCEUI_FDSInsertFunction · 0.85
FCEUI_SaveSnapshotFunction · 0.85
FCEU_MakeFNameFunction · 0.85
FCEUI_SaveMovieFunction · 0.85
FCEUI_SaveStateFunction · 0.85
FCEUI_StopMovieFunction · 0.85
FCEUI_LoadMovieFunction · 0.85
FCEUI_LoadStateFunction · 0.85

Tested by

no test coverage detected