mirror of https://github.com/stella-emu/stella.git
allow remapping of fire button for trackball and light gun games
This commit is contained in:
parent
c98629892d
commit
1ee718332a
|
@ -115,7 +115,11 @@ bool Lightgun::read(DigitalPin pin)
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void Lightgun::update()
|
||||
{
|
||||
// we allow left and right mouse buttons for fire button
|
||||
setPin(DigitalPin::One, myEvent.get(Event::MouseButtonLeftValue)
|
||||
|| myEvent.get(Event::MouseButtonRightValue));
|
||||
// Digital events (from keyboard or joystick hats & buttons)
|
||||
setPin(DigitalPin::One, myEvent.get(Event::JoystickZeroFire) == 0);
|
||||
|
||||
// We allow left and right mouse buttons for fire button
|
||||
if(myEvent.get(Event::MouseButtonLeftValue) ||
|
||||
myEvent.get(Event::MouseButtonRightValue))
|
||||
setPin(DigitalPin::One, false);
|
||||
}
|
||||
|
|
|
@ -86,9 +86,13 @@ void PointingDevice::update()
|
|||
updateDirection(-myEvent.get(Event::MouseAxisYMove), myVCounterRemainder,
|
||||
myTrackBallDown, myTrackBallLinesV, myScanCountV, myFirstScanOffsetV);
|
||||
|
||||
// Get mouse button state
|
||||
setPin(DigitalPin::Six, (myEvent.get(Event::MouseButtonLeftValue) == 0) &&
|
||||
(myEvent.get(Event::MouseButtonRightValue) == 0));
|
||||
// Digital events (from keyboard or joystick hats & buttons)
|
||||
setPin(DigitalPin::Six, myEvent.get(Event::JoystickZeroFire) == 0);
|
||||
|
||||
// We allow left and right mouse buttons for fire button
|
||||
if(myEvent.get(Event::MouseButtonLeftValue) ||
|
||||
myEvent.get(Event::MouseButtonRightValue))
|
||||
setPin(DigitalPin::Six, false);
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
|
Loading…
Reference in New Issue