[gnome-games/wip/aplazas/gamepad-event: 10/14] gamepad: Stop emitting specific gamepad events
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/wip/aplazas/gamepad-event: 10/14] gamepad: Stop emitting specific gamepad events
- Date: Sat, 13 May 2017 09:37:57 +0000 (UTC)
commit e55ff79cd3cc74de2dc9f460b7b2403db6493b80
Author: Adrien Plazas <kekun plazas laposte net>
Date: Fri May 12 23:15:12 2017 +0200
gamepad: Stop emitting specific gamepad events
Don't emit any '*-event' signal so 'event' is the only signal emitting
gamepad events as they are not listend to anymore.
src/gamepad/linux/linux-raw-gamepad.c | 56 ---------------------------------
1 files changed, 0 insertions(+), 56 deletions(-)
---
diff --git a/src/gamepad/linux/linux-raw-gamepad.c b/src/gamepad/linux/linux-raw-gamepad.c
index bafb4fb..b439a36 100644
--- a/src/gamepad/linux/linux-raw-gamepad.c
+++ b/src/gamepad/linux/linux-raw-gamepad.c
@@ -241,62 +241,6 @@ handle_evdev_event (GamesLinuxRawGamepad *self)
}
g_signal_emit_by_name (GAMES_RAW_GAMEPAD (self), "event", &games_event);
-
- // FIXME Should not cast from uint to int? No need to store it?
- code = (gint) event.code;
- switch (event.type) {
- case EV_KEY:
- if ((code & BTN_GAMEPAD) == BTN_GAMEPAD)
- g_signal_emit_by_name ((GamesRawGamepad*) self,
- "standard-button-event",
- button_to_standard_button (code),
- (gboolean) event.value);
- g_signal_emit_by_name ((GamesRawGamepad*) self,
- "button-event",
- (gint) self->key_map[code - BTN_MISC],
- (gboolean) event.value);
-
- break;
- case EV_ABS:
-
- switch (code) {
- case ABS_HAT0X:
- case ABS_HAT0Y:
- case ABS_HAT1X:
- case ABS_HAT1Y:
- case ABS_HAT2X:
- case ABS_HAT2Y:
- case ABS_HAT3X:
- case ABS_HAT3Y:
- code = code - ABS_HAT0X;
- g_signal_emit_by_name ((GamesRawGamepad*) self,
- "dpad-event",
- code / 2,
- code % 2,
- (gint) event.value);
-
- // TODO Should still emit the 'event' signal.
- return;
- case ABS_X:
- case ABS_Y:
- case ABS_RX:
- case ABS_RY:
- axis = self->abs_map[code];
- value = centered_axis_value (&self->abs_info[axis], event.value);
- g_signal_emit_by_name ((GamesRawGamepad*) self,
- "standard-axis-event",
- axis_to_standard_axis (code),
- value);
-
- break;
- }
-
- axis = self->abs_map[code];
- value = centered_axis_value (&self->abs_info[axis], event.value);
- g_signal_emit_by_name ((GamesRawGamepad*) self, "axis-event", (gint) axis, value);
-
- break;
- }
}
static gboolean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]