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
Haptics and Controller power-off #9663
Conversation
@@ -39,15 +42,25 @@ CAddonInputHandling::CAddonInputHandling(CPeripheral* peripheral, IInputHandler* | |||
{ | |||
m_buttonMap.reset(new CAddonButtonMap(peripheral, addon, handler->ControllerID())); | |||
if (m_buttonMap->Load()) | |||
m_driverHandler.reset(new CInputHandling(handler, m_buttonMap.get())); | |||
else | |||
m_buttonMap.reset(); |
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.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
BTW the Android API supports vibration patterns, see http://developer.android.com/reference/android/os/Vibrator.html. Maybe that might be something that would be useful for other stuff as well? I don't really know how libretro provides rumble events though. |
Will haptics (rumble) have GUI options to be disabled and enabled? Maybe even have GUI settings to enable or disable rumble for different things? I know that at least I would not want to have rumble enabled for notifications by default but I would like to have it enabled in games by default. |
@garbear is there a branch in |
nvm I pulled together the necessary commits, squashed them as good as possible and added mine on top, see https://github.com/Montellese/peripheral.joystick/commits/joystick_poweroff in case you are interested in the squashed commits. And https://github.com/Montellese/xbmc/commits/joystick_shutdown has my commits on top of this PR. |
@Hedda I'm wary of settings creep, but I can see your point, it might be annoying if all 4 controllers rumble every time a notification is shown. What if we drop the commit and only rumble in games? I added rumble on notifications as more of a proof of concept anyway. @Montellese you're right, the rumble command should go somewhere else in case multiple notifications are queued. Thanks for the power off support, should I tack that on and make this a dual-feature PR? |
You can include it here or I can provide it as a separate PR once this has gone in, I don't really care. |
OK, I'll save you the trouble and add it here. So what's the consensus? Do we drop rumble-on-notification for now? Once rumble functionality is in it'll be trivial to add it later. Also, rumble can be made less annoying by shortening the duration or lowering the intensity (motors support values from 0.0 to 1.0) |
I'd either make the rumble on notifications configurable or remove it completely. |
f38d1b7
to
6ca89b4
Compare
{ | ||
CPeripheralJoystick* joystick = static_cast<CPeripheralJoystick*>(peripheral.second); | ||
if (joystick->SupportsPowerOff()) | ||
PowerOffJoystick(joystick->RequestedPort()); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
I'll add a setting. The input page in system settings is getting a little crowded, but this is fixed in my RetroPlayer work - all controller settings are moved to a "game input" page |
@@ -15568,7 +15568,19 @@ msgctxt "#35050" | |||
msgid "Controller profiles" | |||
msgstr "" | |||
|
|||
#empty strings from id 35051 to 35054 | |||
#. Setting to test rumble |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
jenkins build this please (to test if I rebased on alpha 2 properly) |
@garbear nudge |
The major thing stopping this was a crash if you disconnected the controller shortly after connecting it. My wireless 360 controller had low batteries, and when it connected Kodi told it to rumble and the rumble drew too much power and killed the controller and crashed Kodi :) Fixing this will require a bit of refactoring. I rebased this patch on master last night, I'll try to look into the crash soon. |
@garbear well v16 crashed when even a controller was connected. |
… it on shutdown (configurable)
Rebased on master. I'll look into the crash |
Fixed the crash. jenkins build this please |
@MartijnKaijser ok to merge? |
Is there a way to disable the rumble? its horrible for each notification. The Pad lies on a table and its extreme loud when it rumbles on max speed |
This PR activates controller rumble motors when the user receives a notification. Also, thanks to Montellese, we have the ability to power off controllers on exit.
Two settings are added:
This PR currently relies on the retroplayer branch of peripheral.joystick. These changes will be merged to master when this PR is merged.
ATM, rumble and power-off-on-exit are only supported via the XInput API on windows. Additional APIs can be added at a later date independent of Kodi.