14
14
// See the file "License.txt" for information on usage and redistribution of
15
15
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
17
// $Id: EventHandler.cxx 2418 2012-03-16 17:57:23Z stephena $
17
// $Id: EventHandler.cxx 2501 2012-05-26 22:18:13Z stephena $
18
18
//============================================================================
329
329
bool state = event.key.type == SDL_KEYDOWN;
330
330
bool handled = true;
332
// Immediately store the key state
333
myEvent.setKey(key, state);
332
335
// An attempt to speed up event processing
333
336
// All SDL-specific event actions are accessed by either
334
337
// Control or Alt/Cmd keys. So we quickly check for those.
375
378
myOSystem->console().changeYStart(-1);
381
case KBDK_1: // Alt-1 turns off NTSC filtering
382
myOSystem->frameBuffer().setNTSC(NTSCFilter::PRESET_OFF);
385
case KBDK_2: // Alt-2 turns on 'composite' NTSC filtering
386
myOSystem->frameBuffer().setNTSC(NTSCFilter::PRESET_COMPOSITE);
389
case KBDK_3: // Alt-3 turns on 'svideo' NTSC filtering
390
myOSystem->frameBuffer().setNTSC(NTSCFilter::PRESET_SVIDEO);
393
case KBDK_4: // Alt-4 turns on 'rgb' NTSC filtering
394
myOSystem->frameBuffer().setNTSC(NTSCFilter::PRESET_RGB);
397
case KBDK_5: // Alt-5 turns on 'bad' NTSC filtering
398
myOSystem->frameBuffer().setNTSC(NTSCFilter::PRESET_BAD);
401
case KBDK_6: // Alt-6 turns on 'custom' NTSC filtering
402
myOSystem->frameBuffer().setNTSC(NTSCFilter::PRESET_CUSTOM);
405
case KBDK_7: // Alt-7 changes scanline intensity for NTSC filtering
407
myOSystem->frameBuffer().setScanlineIntensity(-5);
409
myOSystem->frameBuffer().setScanlineIntensity(+5);
412
case KBDK_8: // Alt-8 turns toggles scanline interpolation
413
myOSystem->frameBuffer().toggleScanlineInterpolation();
416
case KBDK_9: // Alt-9 selects various custom adjustables for NTSC filtering
417
if(myOSystem->frameBuffer().ntscEnabled())
420
myOSystem->frameBuffer().showMessage(
421
myOSystem->frameBuffer().ntsc().setPreviousAdjustable());
423
myOSystem->frameBuffer().showMessage(
424
myOSystem->frameBuffer().ntsc().setNextAdjustable());
428
case KBDK_0: // Alt-0 changes custom adjustables for NTSC filtering
429
if(myOSystem->frameBuffer().ntscEnabled())
432
myOSystem->frameBuffer().showMessage(
433
myOSystem->frameBuffer().ntsc().decreaseAdjustable());
435
myOSystem->frameBuffer().showMessage(
436
myOSystem->frameBuffer().ntsc().increaseAdjustable());
379
441
if(mod & KMOD_SHIFT)
380
442
myOSystem->console().toggleP0Collision();
428
490
case KBDK_PERIOD:
429
491
if(mod & KMOD_SHIFT)
430
myOSystem->console().enableCollisions(false);
432
myOSystem->console().enableBits(false);
437
myOSystem->console().enableCollisions(true);
439
myOSystem->console().enableBits(true);
492
myOSystem->console().toggleCollisions();
494
myOSystem->console().toggleBits();
442
497
case KBDK_p: // Alt-p toggles phosphor effect
515
570
case KBDK_0: // Ctrl-0 switches between mouse control modes
516
571
if(myMouseControl)
518
const string& message = myMouseControl->next();
519
myOSystem->frameBuffer().showMessage(message);
572
myOSystem->frameBuffer().showMessage(myMouseControl->next());
523
575
case KBDK_1: // Ctrl-1 swaps Stelladaptor/2600-daptor ports
1025
1077
if((myState == S_EMULATE || myState == S_CMDMENU ||
1026
1078
myState == S_DEBUGGER) && state)
1028
myOSystem->settings().saveConfig();
1030
1080
// Go back to the launcher, or immediately quit
1031
if(myOSystem->settings().getBool("uselauncher"))
1081
if(myOSystem->settings().getBool("exitlauncher") ||
1082
myOSystem->launcherUsed())
1033
1084
myOSystem->deleteConsole();
1034
1085
myOSystem->createLauncher();
1962
2012
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1963
void EventHandler::setMouseControllerMode(const string& mode)
2013
void EventHandler::setMouseControllerMode(bool enable)
1965
delete myMouseControl; myMouseControl = NULL;
1966
2015
if(&myOSystem->console())
1968
const string& control = mode == "rom" ?
1969
myOSystem->console().properties().get(Controller_MouseAxis) : mode;
2017
delete myMouseControl; myMouseControl = NULL;
2019
const string& control = enable ?
2020
myOSystem->console().properties().get(Controller_MouseAxis) : "none";
1971
2022
myMouseControl = new MouseControl(myOSystem->console(), control);
1972
2023
myMouseControl->next(); // set first available mode