mirror of https://github.com/stella-emu/stella.git
Moved two more mouse settings to Mouse tab
This commit is contained in:
parent
71d5cb723a
commit
838cba2d16
|
@ -127,10 +127,9 @@ void InputDialog::addDevicePortTab()
|
||||||
"Joystick deadzone size", lwidth, kDeadzoneChanged, 5 * fontWidth);
|
"Joystick deadzone size", lwidth, kDeadzoneChanged, 5 * fontWidth);
|
||||||
myDeadzone->setMinValue(0); myDeadzone->setMaxValue(29);
|
myDeadzone->setMinValue(0); myDeadzone->setMaxValue(29);
|
||||||
myDeadzone->setTickmarkIntervals(4);
|
myDeadzone->setTickmarkIntervals(4);
|
||||||
xpos = HBORDER + myDeadzone->getWidth() + 5;
|
|
||||||
wid.push_back(myDeadzone);
|
wid.push_back(myDeadzone);
|
||||||
|
|
||||||
xpos = HBORDER; ypos += lineHeight + VGAP * 2;
|
xpos = HBORDER; ypos += lineHeight + VGAP * 4;
|
||||||
new StaticTextWidget(myTab, _font, xpos, ypos+1, "Analog paddle:");
|
new StaticTextWidget(myTab, _font, xpos, ypos+1, "Analog paddle:");
|
||||||
xpos += fontWidth * 2;
|
xpos += fontWidth * 2;
|
||||||
|
|
||||||
|
@ -165,7 +164,7 @@ void InputDialog::addDevicePortTab()
|
||||||
wid.push_back(myDejitterDiff);
|
wid.push_back(myDejitterDiff);
|
||||||
|
|
||||||
// Add paddle speed (digital emulation)
|
// Add paddle speed (digital emulation)
|
||||||
ypos += lineHeight + VGAP * 3;
|
ypos += lineHeight + VGAP * 4;
|
||||||
myDPaddleSpeed = new SliderWidget(myTab, _font, HBORDER, ypos - 1, 13 * fontWidth, lineHeight,
|
myDPaddleSpeed = new SliderWidget(myTab, _font, HBORDER, ypos - 1, 13 * fontWidth, lineHeight,
|
||||||
"Digital paddle sensitivity",
|
"Digital paddle sensitivity",
|
||||||
lwidth, kDPSpeedChanged, 4 * fontWidth, "%");
|
lwidth, kDPSpeedChanged, 4 * fontWidth, "%");
|
||||||
|
@ -173,26 +172,8 @@ void InputDialog::addDevicePortTab()
|
||||||
myDPaddleSpeed->setTickmarkIntervals(4);
|
myDPaddleSpeed->setTickmarkIntervals(4);
|
||||||
wid.push_back(myDPaddleSpeed);
|
wid.push_back(myDPaddleSpeed);
|
||||||
|
|
||||||
// Add trackball speed
|
|
||||||
ypos += lineHeight + VGAP;
|
|
||||||
myTrackBallSpeed = new SliderWidget(myTab, _font, HBORDER, ypos - 1, 13 * fontWidth, lineHeight,
|
|
||||||
"Trackball sensitivity",
|
|
||||||
lwidth, kTBSpeedChanged, 4 * fontWidth, "%");
|
|
||||||
myTrackBallSpeed->setMinValue(1); myTrackBallSpeed->setMaxValue(20);
|
|
||||||
myTrackBallSpeed->setTickmarkIntervals(4);
|
|
||||||
wid.push_back(myTrackBallSpeed);
|
|
||||||
|
|
||||||
// Add driving controller speed
|
|
||||||
ypos += lineHeight + VGAP;
|
|
||||||
myDrivingSpeed = new SliderWidget(myTab, _font, HBORDER, ypos - 1, 13 * fontWidth, lineHeight,
|
|
||||||
"Driving contr. sensitivity",
|
|
||||||
lwidth, kDCSpeedChanged, 4 * fontWidth, "%");
|
|
||||||
myDrivingSpeed->setMinValue(1); myDrivingSpeed->setMaxValue(20);
|
|
||||||
myDrivingSpeed->setTickmarkIntervals(4);
|
|
||||||
wid.push_back(myDrivingSpeed);
|
|
||||||
|
|
||||||
// Add 'allow all 4 directions' for joystick
|
// Add 'allow all 4 directions' for joystick
|
||||||
ypos += lineHeight + VGAP * 3;
|
ypos += lineHeight + VGAP * 4;
|
||||||
myAllowAll4 = new CheckboxWidget(myTab, _font, HBORDER, ypos,
|
myAllowAll4 = new CheckboxWidget(myTab, _font, HBORDER, ypos,
|
||||||
"Allow all 4 directions on joystick");
|
"Allow all 4 directions on joystick");
|
||||||
wid.push_back(myAllowAll4);
|
wid.push_back(myAllowAll4);
|
||||||
|
@ -231,7 +212,7 @@ void InputDialog::addDevicePortTab()
|
||||||
wid.push_back(myEraseEEPROMButton);
|
wid.push_back(myEraseEEPROMButton);
|
||||||
|
|
||||||
// Add AtariVox serial port
|
// Add AtariVox serial port
|
||||||
ypos += lineHeight + VGAP * 2;
|
ypos += lineHeight + VGAP * 3;
|
||||||
lwidth = _font.getStringWidth("AVox serial port ");
|
lwidth = _font.getStringWidth("AVox serial port ");
|
||||||
fwidth = _w - HBORDER * 2 - 2 - lwidth;
|
fwidth = _w - HBORDER * 2 - 2 - lwidth;
|
||||||
new StaticTextWidget(myTab, _font, HBORDER, ypos + 2, "AVox serial port ");
|
new StaticTextWidget(myTab, _font, HBORDER, ypos + 2, "AVox serial port ");
|
||||||
|
@ -252,7 +233,8 @@ void InputDialog::addMouseTab()
|
||||||
const int VGAP = fontHeight / 4;
|
const int VGAP = fontHeight / 4;
|
||||||
const int VBORDER = fontHeight / 2;
|
const int VBORDER = fontHeight / 2;
|
||||||
const int HBORDER = fontWidth * 1.25;
|
const int HBORDER = fontWidth * 1.25;
|
||||||
int ypos, lwidth, pwidth, tabID;
|
const int INDENT = fontWidth * 2;
|
||||||
|
int xpos = HBORDER, ypos, lwidth, pwidth, tabID;
|
||||||
WidgetArray wid;
|
WidgetArray wid;
|
||||||
VariantList items;
|
VariantList items;
|
||||||
|
|
||||||
|
@ -267,21 +249,43 @@ void InputDialog::addMouseTab()
|
||||||
VarList::push_back(items, "Always", "always");
|
VarList::push_back(items, "Always", "always");
|
||||||
VarList::push_back(items, "Analog devices", "analog");
|
VarList::push_back(items, "Analog devices", "analog");
|
||||||
VarList::push_back(items, "Never", "never");
|
VarList::push_back(items, "Never", "never");
|
||||||
myMouseControl = new PopUpWidget(myTab, _font, HBORDER, ypos, pwidth, lineHeight, items,
|
myMouseControl = new PopUpWidget(myTab, _font, xpos, ypos, pwidth, lineHeight, items,
|
||||||
"Use mouse as a controller ", lwidth, kMouseCtrlChanged);
|
"Use mouse as a controller ", lwidth, kMouseCtrlChanged);
|
||||||
wid.push_back(myMouseControl);
|
wid.push_back(myMouseControl);
|
||||||
|
|
||||||
// Add paddle speed (mouse emulation)
|
|
||||||
ypos += lineHeight + VGAP;
|
ypos += lineHeight + VGAP;
|
||||||
myMPaddleSpeed = new SliderWidget(myTab, _font, HBORDER, ypos - 1, 13 * fontWidth, lineHeight,
|
myMouseSensitivity = new StaticTextWidget(myTab, _font, xpos, ypos + 1, "Sensitivity:");
|
||||||
"Mouse paddle sensitivity ",
|
|
||||||
|
// Add paddle speed (mouse emulation)
|
||||||
|
xpos += INDENT; ypos += lineHeight + VGAP;
|
||||||
|
lwidth -= INDENT;
|
||||||
|
myMPaddleSpeed = new SliderWidget(myTab, _font, xpos, ypos - 1, 13 * fontWidth, lineHeight,
|
||||||
|
"Paddle",
|
||||||
lwidth, kMPSpeedChanged, 4 * fontWidth, "%");
|
lwidth, kMPSpeedChanged, 4 * fontWidth, "%");
|
||||||
myMPaddleSpeed->setMinValue(1); myMPaddleSpeed->setMaxValue(20);
|
myMPaddleSpeed->setMinValue(1); myMPaddleSpeed->setMaxValue(20);
|
||||||
myMPaddleSpeed->setTickmarkIntervals(4);
|
myMPaddleSpeed->setTickmarkIntervals(4);
|
||||||
wid.push_back(myMPaddleSpeed);
|
wid.push_back(myMPaddleSpeed);
|
||||||
|
|
||||||
|
// Add trackball speed
|
||||||
|
ypos += lineHeight + VGAP;
|
||||||
|
myTrackBallSpeed = new SliderWidget(myTab, _font, xpos, ypos - 1, 13 * fontWidth, lineHeight,
|
||||||
|
"Trackball",
|
||||||
|
lwidth, kTBSpeedChanged, 4 * fontWidth, "%");
|
||||||
|
myTrackBallSpeed->setMinValue(1); myTrackBallSpeed->setMaxValue(20);
|
||||||
|
myTrackBallSpeed->setTickmarkIntervals(4);
|
||||||
|
wid.push_back(myTrackBallSpeed);
|
||||||
|
|
||||||
|
// Add driving controller speed
|
||||||
|
ypos += lineHeight + VGAP;
|
||||||
|
myDrivingSpeed = new SliderWidget(myTab, _font, xpos, ypos - 1, 13 * fontWidth, lineHeight,
|
||||||
|
"Driving controller",
|
||||||
|
lwidth, kDCSpeedChanged, 4 * fontWidth, "%");
|
||||||
|
myDrivingSpeed->setMinValue(1); myDrivingSpeed->setMaxValue(20);
|
||||||
|
myDrivingSpeed->setTickmarkIntervals(4);
|
||||||
|
wid.push_back(myDrivingSpeed);
|
||||||
|
|
||||||
// Mouse cursor state
|
// Mouse cursor state
|
||||||
|
lwidth += INDENT;
|
||||||
ypos += lineHeight + VGAP * 4;
|
ypos += lineHeight + VGAP * 4;
|
||||||
items.clear();
|
items.clear();
|
||||||
VarList::push_back(items, "-UI, -Emulation", "0");
|
VarList::push_back(items, "-UI, -Emulation", "0");
|
||||||
|
@ -473,9 +477,6 @@ void InputDialog::setDefaults()
|
||||||
myDejitterBase->setValue(0);
|
myDejitterBase->setValue(0);
|
||||||
myDejitterDiff->setValue(0);
|
myDejitterDiff->setValue(0);
|
||||||
#endif
|
#endif
|
||||||
myDrivingSpeed->setValue(10);
|
|
||||||
myTrackBallSpeed->setValue(10);
|
|
||||||
|
|
||||||
// AtariVox serial port
|
// AtariVox serial port
|
||||||
myAVoxPort->setText("");
|
myAVoxPort->setText("");
|
||||||
|
|
||||||
|
@ -491,15 +492,17 @@ void InputDialog::setDefaults()
|
||||||
// Use mouse as a controller
|
// Use mouse as a controller
|
||||||
myMouseControl->setSelected("analog");
|
myMouseControl->setSelected("analog");
|
||||||
|
|
||||||
|
// Paddle speed (mouse)
|
||||||
|
myMPaddleSpeed->setValue(10);
|
||||||
|
myTrackBallSpeed->setValue(10);
|
||||||
|
myDrivingSpeed->setValue(10);
|
||||||
|
|
||||||
// Mouse cursor state
|
// Mouse cursor state
|
||||||
myCursorState->setSelected("2");
|
myCursorState->setSelected("2");
|
||||||
|
|
||||||
// Grab mouse
|
// Grab mouse
|
||||||
myGrabMouse->setState(true);
|
myGrabMouse->setState(true);
|
||||||
|
|
||||||
// Paddle speed (mouse)
|
|
||||||
myMPaddleSpeed->setValue(10);
|
|
||||||
|
|
||||||
handleMouseControlState();
|
handleMouseControlState();
|
||||||
handleCursorState();
|
handleCursorState();
|
||||||
break;
|
break;
|
||||||
|
@ -691,6 +694,7 @@ void InputDialog::handleCommand(CommandSender* sender, int cmd,
|
||||||
|
|
||||||
case kMouseCtrlChanged:
|
case kMouseCtrlChanged:
|
||||||
handleMouseControlState();
|
handleMouseControlState();
|
||||||
|
handleCursorState();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kCursorStateChanged:
|
case kCursorStateChanged:
|
||||||
|
@ -725,14 +729,19 @@ void InputDialog::updateDejitterReaction()
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void InputDialog::handleMouseControlState()
|
void InputDialog::handleMouseControlState()
|
||||||
{
|
{
|
||||||
myMPaddleSpeed->setEnabled(myMouseControl->getSelected() != 2);
|
bool enable = myMouseControl->getSelected() != 2;
|
||||||
|
|
||||||
|
myMouseSensitivity->setEnabled(enable);
|
||||||
|
myMPaddleSpeed->setEnabled(enable);
|
||||||
|
myTrackBallSpeed->setEnabled(enable);
|
||||||
|
myDrivingSpeed->setEnabled(enable);
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void InputDialog::handleCursorState()
|
void InputDialog::handleCursorState()
|
||||||
{
|
{
|
||||||
int state = myCursorState->getSelected();
|
int state = myCursorState->getSelected();
|
||||||
bool enableGrab = state != 1 && state != 3;
|
bool enableGrab = state != 1 && state != 3 && myMouseControl->getSelected() != 2;
|
||||||
|
|
||||||
myGrabMouse->setEnabled(enableGrab);
|
myGrabMouse->setEnabled(enableGrab);
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,9 +91,7 @@ class InputDialog : public Dialog
|
||||||
EventMappingWidget* myEmulEventMapper{nullptr};
|
EventMappingWidget* myEmulEventMapper{nullptr};
|
||||||
EventMappingWidget* myMenuEventMapper{nullptr};
|
EventMappingWidget* myMenuEventMapper{nullptr};
|
||||||
|
|
||||||
CheckboxWidget* mySAPort{nullptr};
|
CheckboxWidget* mySAPort{nullptr};
|
||||||
PopUpWidget* myMouseControl{nullptr};
|
|
||||||
PopUpWidget* myCursorState{nullptr};
|
|
||||||
|
|
||||||
EditTextWidget* myAVoxPort{nullptr};
|
EditTextWidget* myAVoxPort{nullptr};
|
||||||
|
|
||||||
|
@ -102,16 +100,20 @@ class InputDialog : public Dialog
|
||||||
SliderWidget* myDejitterBase{nullptr};
|
SliderWidget* myDejitterBase{nullptr};
|
||||||
SliderWidget* myDejitterDiff{nullptr};
|
SliderWidget* myDejitterDiff{nullptr};
|
||||||
SliderWidget* myDPaddleSpeed{nullptr};
|
SliderWidget* myDPaddleSpeed{nullptr};
|
||||||
SliderWidget* myMPaddleSpeed{nullptr};
|
|
||||||
SliderWidget* myTrackBallSpeed{nullptr};
|
|
||||||
SliderWidget* myDrivingSpeed{nullptr};
|
|
||||||
CheckboxWidget* myAllowAll4{nullptr};
|
CheckboxWidget* myAllowAll4{nullptr};
|
||||||
CheckboxWidget* myGrabMouse{nullptr};
|
|
||||||
CheckboxWidget* myModCombo{nullptr};
|
CheckboxWidget* myModCombo{nullptr};
|
||||||
|
|
||||||
ButtonWidget* myJoyDlgButton{nullptr};
|
ButtonWidget* myJoyDlgButton{nullptr};
|
||||||
ButtonWidget* myEraseEEPROMButton{nullptr};
|
ButtonWidget* myEraseEEPROMButton{nullptr};
|
||||||
|
|
||||||
|
PopUpWidget* myMouseControl{nullptr};
|
||||||
|
StaticTextWidget* myMouseSensitivity{nullptr};
|
||||||
|
SliderWidget* myMPaddleSpeed{nullptr};
|
||||||
|
SliderWidget* myTrackBallSpeed{nullptr};
|
||||||
|
SliderWidget* myDrivingSpeed{nullptr};
|
||||||
|
PopUpWidget* myCursorState{nullptr};
|
||||||
|
CheckboxWidget* myGrabMouse{nullptr};
|
||||||
|
|
||||||
// Show the list of joysticks that the eventhandler knows about
|
// Show the list of joysticks that the eventhandler knows about
|
||||||
unique_ptr<JoystickDialog> myJoyDialog;
|
unique_ptr<JoystickDialog> myJoyDialog;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue