[retro-gtk] input: Remove useless Keyboard type



commit e60214e36d2cb02ef5089c635ea55795d32ebdc9
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Fri Jul 21 11:17:49 2017 +0200

    input: Remove useless Keyboard type
    
    https://bugzilla.gnome.org/show_bug.cgi?id=777489

 retro-gtk/Makefile.am                     |    1 -
 retro-gtk/input/input-device-manager.vala |    8 +++-----
 retro-gtk/input/keyboard.vala             |   16 ----------------
 retro-gtk/retro-core-view.vala            |    4 +---
 4 files changed, 4 insertions(+), 25 deletions(-)
---
diff --git a/retro-gtk/Makefile.am b/retro-gtk/Makefile.am
index 40c2dec..7315fc7 100644
--- a/retro-gtk/Makefile.am
+++ b/retro-gtk/Makefile.am
@@ -36,7 +36,6 @@ libretro_gtk_la_SOURCES = \
        input/input.vala \
        input/input-device.vala \
        input/input-device-manager.vala \
-       input/keyboard.vala \
        input/keyboard-state.vala \
        input/mouse.vala \
        input/retro-keyboard-key.c \
diff --git a/retro-gtk/input/input-device-manager.vala b/retro-gtk/input/input-device-manager.vala
index 653cc72..bd63e08 100644
--- a/retro-gtk/input/input-device-manager.vala
+++ b/retro-gtk/input/input-device-manager.vala
@@ -4,7 +4,6 @@ namespace Retro {
 
 public class InputDeviceManager : Object, Input {
        private HashTable<uint?, InputDevice> controller_devices;
-       private Keyboard keyboard;
 
        construct {
                controller_devices = new HashTable<int?, InputDevice> (int_hash, int_equal);
@@ -46,10 +45,9 @@ public class InputDeviceManager : Object, Input {
                controller_connected (port, device);
        }
 
-       public void set_keyboard (Keyboard keyboard) {
-               this.keyboard = keyboard;
-
-               keyboard.key_event.connect ((k, e) => key_event (e));
+       public void set_keyboard (Gtk.Widget widget) {
+               widget.key_press_event.connect ((w, e) => key_event (e));
+               widget.key_release_event.connect ((w, e) => key_event (e));
        }
 
        public void remove_controller_device (uint port) {
diff --git a/retro-gtk/retro-core-view.vala b/retro-gtk/retro-core-view.vala
index d46d55e..5bb67b0 100644
--- a/retro-gtk/retro-core-view.vala
+++ b/retro-gtk/retro-core-view.vala
@@ -4,7 +4,6 @@ public class Retro.CoreView : Gtk.EventBox {
        private Core core;
        private CairoDisplay display;
        private InputDeviceManager input;
-       private Keyboard keyboard;
        private Mouse mouse;
 
        construct {
@@ -16,10 +15,9 @@ public class Retro.CoreView : Gtk.EventBox {
                add (display);
 
                input = new InputDeviceManager ();
-               keyboard = new Keyboard (this);
                mouse = new Mouse (this);
 
-               input.set_keyboard (keyboard);
+               input.set_keyboard (this);
                input.set_controller_device (0, mouse);
        }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]