[gnome-games] gamepad: Forward standard axis events
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] gamepad: Forward standard axis events
- Date: Sat, 27 Aug 2016 07:14:25 +0000 (UTC)
commit d971c23a709c45efa106af0684e44b64ae45ff58
Author: Adrien Plazas <kekun plazas laposte net>
Date: Sat Aug 27 08:17:55 2016 +0200
gamepad: Forward standard axis events
This allow standard axis events to be handled by gamepads without a
mapping.
https://bugzilla.gnome.org/show_bug.cgi?id=770468
src/gamepad/gamepad.vala | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/gamepad/gamepad.vala b/src/gamepad/gamepad.vala
index 3811222..ff168fa 100644
--- a/src/gamepad/gamepad.vala
+++ b/src/gamepad/gamepad.vala
@@ -41,6 +41,7 @@ private class Games.Gamepad : Object {
}
raw_gamepad.standard_button_event.connect (on_standard_button_event);
raw_gamepad.button_event.connect (on_raw_button_event);
+ raw_gamepad.standard_axis_event.connect (on_standard_axis_event);
raw_gamepad.axis_event.connect (on_raw_axis_event);
raw_gamepad.dpad_event.connect (on_raw_dpad_event);
raw_gamepad.unplugged.connect (() => unplugged ());
@@ -70,6 +71,13 @@ private class Games.Gamepad : Object {
}
}
+ private void on_standard_axis_event (StandardGamepadAxis axis, double value) {
+ if (mapping != null)
+ return;
+
+ axis_event (axis, value);
+ }
+
private void on_raw_axis_event (int axis, double value) {
if (mapping == null)
return;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]