mirror of https://github.com/stella-emu/stella.git
Fixed some issues I forgot in the last commit. When mapping an event,
the first event seen is now used. So that means once 'Map' is pressed in the EventMapper, you can no longer move the cursor using the joystick axis; that axis event will be remapped to whatever action your remapping. Disabled double-clicking in EventMapper activating remap mode, since it causes problems when using joystick buttons as mouse clicks. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@925 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
2a8d708620
commit
d76781c5ed
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: Settings.cxx,v 1.68 2005-12-16 14:41:14 stephena Exp $
|
// $Id: Settings.cxx,v 1.69 2005-12-24 22:50:52 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
@ -60,7 +60,6 @@ Settings::Settings(OSystem* osystem)
|
||||||
set("joymap", "");
|
set("joymap", "");
|
||||||
set("joyaxismap", "");
|
set("joyaxismap", "");
|
||||||
set("paddle", "0");
|
set("paddle", "0");
|
||||||
set("joymouse", "false");
|
|
||||||
set("sa1", "left");
|
set("sa1", "left");
|
||||||
set("sa2", "right");
|
set("sa2", "right");
|
||||||
set("mspeed", "50");
|
set("mspeed", "50");
|
||||||
|
@ -289,7 +288,6 @@ void Settings::usage()
|
||||||
<< endl
|
<< endl
|
||||||
#endif
|
#endif
|
||||||
<< " -paddle <0|1|2|3> Indicates which paddle the mouse should emulate\n"
|
<< " -paddle <0|1|2|3> Indicates which paddle the mouse should emulate\n"
|
||||||
<< " -joymouse <1|0> Enable joystick emulates mouse in GUI\n"
|
|
||||||
<< " -showinfo <1|0> Shows some game info\n"
|
<< " -showinfo <1|0> Shows some game info\n"
|
||||||
<< " -sa1 <left|right> Stelladaptor 1 emulates specified joystick port\n"
|
<< " -sa1 <left|right> Stelladaptor 1 emulates specified joystick port\n"
|
||||||
<< " -sa2 <left|right> Stelladaptor 2 emulates specified joystick port\n"
|
<< " -sa2 <left|right> Stelladaptor 2 emulates specified joystick port\n"
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: CommandMenu.cxx,v 1.2 2005-12-24 22:09:36 stephena Exp $
|
// $Id: CommandMenu.cxx,v 1.3 2005-12-24 22:50:52 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#include "Dialog.hxx"
|
#include "Dialog.hxx"
|
||||||
|
@ -24,9 +24,6 @@
|
||||||
CommandMenu::CommandMenu(OSystem* osystem)
|
CommandMenu::CommandMenu(OSystem* osystem)
|
||||||
: DialogContainer(osystem)
|
: DialogContainer(osystem)
|
||||||
{
|
{
|
||||||
// Tell the DialogContainer that we don't want to emulate mouse motion
|
|
||||||
// with the joystick axis, since we want to directly receive axis events
|
|
||||||
myEmulateMouseFlag = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: Dialog.cxx,v 1.38 2005-12-24 22:09:36 stephena Exp $
|
// $Id: Dialog.cxx,v 1.39 2005-12-24 22:50:52 stephena Exp $
|
||||||
//
|
//
|
||||||
// Based on code from ScummVM - Scumm Interpreter
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
|
@ -280,10 +280,8 @@ void Dialog::handleMouseWheel(int x, int y, int direction)
|
||||||
if(!w)
|
if(!w)
|
||||||
w = _focusedWidget;
|
w = _focusedWidget;
|
||||||
if (w)
|
if (w)
|
||||||
{cerr << w << endl;
|
|
||||||
w->handleMouseWheel(x, y, direction);
|
w->handleMouseWheel(x, y, direction);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void Dialog::handleKeyDown(int ascii, int keycode, int modifiers)
|
void Dialog::handleKeyDown(int ascii, int keycode, int modifiers)
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: DialogContainer.cxx,v 1.21 2005-12-24 22:09:36 stephena Exp $
|
// $Id: DialogContainer.cxx,v 1.22 2005-12-24 22:50:53 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#include "OSystem.hxx"
|
#include "OSystem.hxx"
|
||||||
|
@ -30,8 +30,7 @@ DialogContainer::DialogContainer(OSystem* osystem)
|
||||||
: myOSystem(osystem),
|
: myOSystem(osystem),
|
||||||
myBaseDialog(NULL),
|
myBaseDialog(NULL),
|
||||||
myTime(0),
|
myTime(0),
|
||||||
myRefreshFlag(false),
|
myRefreshFlag(false)
|
||||||
myEmulateMouseFlag(true)
|
|
||||||
{
|
{
|
||||||
memset(&ourJoyMouse, 0, sizeof(JoyMouse));
|
memset(&ourJoyMouse, 0, sizeof(JoyMouse));
|
||||||
ourJoyMouse.delay_time = 25;
|
ourJoyMouse.delay_time = 25;
|
||||||
|
@ -268,7 +267,12 @@ void DialogContainer::handleJoyAxisEvent(int stick, int axis, int value)
|
||||||
if(myDialogStack.empty())
|
if(myDialogStack.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(myEmulateMouseFlag)
|
// Send the event to the dialog box on the top of the stack
|
||||||
|
Dialog* activeDialog = myDialogStack.top();
|
||||||
|
|
||||||
|
if(activeDialog->wantsEvents())
|
||||||
|
activeDialog->handleJoyAxis(stick, axis, value);
|
||||||
|
else
|
||||||
{
|
{
|
||||||
if(value > JOY_DEADZONE)
|
if(value > JOY_DEADZONE)
|
||||||
value -= JOY_DEADZONE;
|
value -= JOY_DEADZONE;
|
||||||
|
@ -306,12 +310,6 @@ void DialogContainer::handleJoyAxisEvent(int stick, int axis, int value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
// Send the event to the dialog box on the top of the stack
|
|
||||||
Dialog* activeDialog = myDialogStack.top();
|
|
||||||
activeDialog->handleJoyAxis(stick, axis, value);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: DialogContainer.hxx,v 1.11 2005-12-24 22:09:36 stephena Exp $
|
// $Id: DialogContainer.hxx,v 1.12 2005-12-24 22:50:53 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#ifndef DIALOG_CONTAINER_HXX
|
#ifndef DIALOG_CONTAINER_HXX
|
||||||
|
@ -37,7 +37,7 @@ typedef FixedStack<Dialog *> DialogStack;
|
||||||
a stack, and handles their events.
|
a stack, and handles their events.
|
||||||
|
|
||||||
@author Stephen Anthony
|
@author Stephen Anthony
|
||||||
@version $Id: DialogContainer.hxx,v 1.11 2005-12-24 22:09:36 stephena Exp $
|
@version $Id: DialogContainer.hxx,v 1.12 2005-12-24 22:50:53 stephena Exp $
|
||||||
*/
|
*/
|
||||||
class DialogContainer
|
class DialogContainer
|
||||||
{
|
{
|
||||||
|
@ -167,9 +167,6 @@ class DialogContainer
|
||||||
// Indicates a full refresh of all dialogs is required
|
// Indicates a full refresh of all dialogs is required
|
||||||
bool myRefreshFlag;
|
bool myRefreshFlag;
|
||||||
|
|
||||||
// Indicates if we should emulate mouse motion events for this container
|
|
||||||
bool myEmulateMouseFlag;
|
|
||||||
|
|
||||||
// For continuous events (keyDown)
|
// For continuous events (keyDown)
|
||||||
struct {
|
struct {
|
||||||
int ascii;
|
int ascii;
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: EventMappingWidget.cxx,v 1.6 2005-12-24 22:09:36 stephena Exp $
|
// $Id: EventMappingWidget.cxx,v 1.7 2005-12-24 22:50:53 stephena Exp $
|
||||||
//
|
//
|
||||||
// Based on code from ScummVM - Scumm Interpreter
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
|
@ -235,6 +235,7 @@ void EventMappingWidget::handleCommand(CommandSender* sender, int cmd,
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
/*
|
||||||
case kListItemDoubleClickedCmd:
|
case kListItemDoubleClickedCmd:
|
||||||
if(myActionsList->getSelected() >= 0)
|
if(myActionsList->getSelected() >= 0)
|
||||||
{
|
{
|
||||||
|
@ -242,6 +243,7 @@ void EventMappingWidget::handleCommand(CommandSender* sender, int cmd,
|
||||||
startRemapping();
|
startRemapping();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
*/
|
||||||
|
|
||||||
case kStartMapCmd:
|
case kStartMapCmd:
|
||||||
startRemapping();
|
startRemapping();
|
||||||
|
|
Loading…
Reference in New Issue