[gnome-games/wip/exalm/keyboard: 2/2] retro-input-manager: Don't set default joypad controller
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/wip/exalm/keyboard: 2/2] retro-input-manager: Don't set default joypad controller
- Date: Fri, 30 Nov 2018 12:42:30 +0000 (UTC)
commit c60664d98054c0ac6d6e4e6eaa419ad7ace813dd
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date: Thu Nov 29 23:28:04 2018 +0500
retro-input-manager: Don't set default joypad controller
Rely on joypad controller on a specific port instead. This allows to
avoid the same input on every port, controlling multiple players at once
on some platforms.
src/retro/retro-input-manager.vala | 18 ++++--------------
1 file changed, 4 insertions(+), 14 deletions(-)
---
diff --git a/src/retro/retro-input-manager.vala b/src/retro/retro-input-manager.vala
index 6a690dd5..cead29ea 100644
--- a/src/retro/retro-input-manager.vala
+++ b/src/retro/retro-input-manager.vala
@@ -14,23 +14,11 @@ private class Games.RetroInputManager : Object {
return;
_input_mode = value;
- switch (value) {
- case InputMode.GAMEPAD:
- core.set_keyboard (null);
- core.set_default_controller (Retro.ControllerType.JOYPAD, core_view_joypad);
- break;
- case InputMode.KEYBOARD:
+ if (value == InputMode.KEYBOARD)
core.set_keyboard (view);
- core.set_default_controller (Retro.ControllerType.JOYPAD, null);
-
- break;
- case InputMode.NONE:
+ else
core.set_keyboard (null);
- core.set_default_controller (Retro.ControllerType.JOYPAD, null);
-
- break;
- }
update_core_view_gamepad ();
}
@@ -55,6 +43,8 @@ private class Games.RetroInputManager : Object {
keyboard_mapping_manager.changed.connect (on_keyboard_mapping_manager_changed);
view.set_as_default_controller (core);
+ // Unset default joypad controller to avoid duplicating input on all ports
+ core.set_default_controller (Retro.ControllerType.JOYPAD, null);
core_view_joypad = view.as_controller (Retro.ControllerType.JOYPAD);
monitor = new Manette.Monitor ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]