-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Controller dialog: Wheel and throttle support #13189
Conversation
4f9310e
to
46c6c49
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found only a few minors. I'm not that deep in this code anymore though.
} | ||
catch (...) | ||
{ | ||
CLog::Log(LOGERROR, "GAME: %s: exception caught in InputEvent()", m_gameClient->ID().c_str()); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -105,6 +105,22 @@ bool CPort::OnAccelerometerMotion(const std::string& feature, float x, float y, | |||
return m_gameInput->OnAccelerometerMotion(feature, x, y, z); | |||
} | |||
|
|||
bool CPort::OnWheelMotion(const std::string& feature, float position, unsigned int motionTimeMs) | |||
{ | |||
if ((position != 0.0f) && !m_gameClient.AcceptsInput()) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
const bool bWasActivated = (m_state != 0.0f); | ||
|
||
if (!bActivated && bWasActivated) | ||
{ |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
motionTimeMs = MotionTimeMs(); | ||
} | ||
else | ||
{ |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
addressed your comments. jenkins build this please |
Needed for analog triggers, wheels and throttles.
jenkins build this please |
This PR adds support for wheels and throttles in the Game API and Peripheral API. These feature types are needed for full Saturn support.
Requires:
Description
Wheels and throttles introduce a new kind of input. Currently, we have buttons (semiaxis) and analog sticks (dual axis). These new features, on the other hand, are composed of a single full axis.
First we modify the Game API to accept events for a single axis. We then use the
buttonmap.xml
belonging to the emulator to map the axis feature to an axis on a libretro device. See kodi-game/game.libretro#23 for more info and examples.Next, we modify the Peripheral API so that we can map axis features. See xbmc/peripheral.joystick#133 for more info and examples. Then we augment the joystick library to handle axis features and connect to the Peripheral API to the Game API.
Finally, we add the ability to map axis features in the Controller Dialog. The buttons for these features use a FSM similar to analog sticks, but instead of prompting for four buttons, they prompt for two.
Motivation and Context
Part of my goal toward a completed player manager.
How Has This Been Tested?
Tested on OSX with an Xbox 360 controller. Possible remaining bugs.
Screenshots (if appropriate):
Types of change