[gnome-games] retro-input-manager: Use KeyboardMappingManager
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] retro-input-manager: Use KeyboardMappingManager
- Date: Fri, 22 Jun 2018 20:43:36 +0000 (UTC)
commit 5f538b64412d7f7376a467c9c1634a1987896bd6
Author: theawless <theawless gmail com>
Date: Wed Jun 6 14:01:38 2018 +0530
retro-input-manager: Use KeyboardMappingManager
This commit makes use of KeyboardMappingManager that was added in
previous commit. This commit enables real-time changes to the mapping.
https://bugzilla.gnome.org/show_bug.cgi?id=780755
src/retro/retro-input-manager.vala | 6 ++++++
1 file changed, 6 insertions(+)
---
diff --git a/src/retro/retro-input-manager.vala b/src/retro/retro-input-manager.vala
index 694ed5f..cfcdd3d 100644
--- a/src/retro/retro-input-manager.vala
+++ b/src/retro/retro-input-manager.vala
@@ -3,6 +3,7 @@
private class Games.RetroInputManager : Object {
private Retro.Core core;
private Retro.Controller core_view_joypad;
+ private KeyboardMappingManager keyboard_mapping_manager;
private Manette.Monitor monitor;
private Retro.Controller?[] controllers;
private int core_view_joypad_port;
@@ -12,6 +13,11 @@ private class Games.RetroInputManager : Object {
this.core = core;
this.present_analog_sticks = present_analog_sticks;
+ keyboard_mapping_manager = new KeyboardMappingManager ();
+ view.set_key_joypad_mapping (keyboard_mapping_manager.mapping);
+ keyboard_mapping_manager.changed.connect (() => {
+ view.set_key_joypad_mapping (keyboard_mapping_manager.mapping);
+ });
core_view_joypad = view.as_controller (Retro.ControllerType.JOYPAD);
core.set_keyboard (view);
view.set_as_default_controller (core);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]