|
From: Yoda-JM <yo...@us...> - 2009-07-26 09:54:52
|
Module: performous
Branch: master
Commit: 791c2a8d7edbbef75b5b3d3178583a5062385a1f
Author: Vincent Le Ligeour <yo...@us...>
Date: Sun Jul 26 11:54:26 2009 +0200
Added GH pick events
---
game/guitargraph.cc | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index a24eba1..ed37ddb 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -91,7 +91,10 @@ GuitarGraph::GuitarGraph(Song const& song): m_song(song), m_button("button.svg")
void GuitarGraph::inputProcess() {
for (Joysticks::iterator it = joysticks.begin(); it != joysticks.end(); ++it) {
for (JoystickEvent ev; it->second.tryPollEvent(ev); ) {
+ // RockBand pick event
if (ev.type == JoystickEvent::HAT_MOTION && ev.hat_direction != JoystickEvent::CENTERED) picked = true;
+ // GuitarHero pick event
+ if (ev.type == JoystickEvent::AXIS_MOTION && ev.axis_id == 5 && ev.axis_value != 0) picked = true;
if (ev.type != JoystickEvent::BUTTON_DOWN && ev.type != JoystickEvent::BUTTON_UP) continue;
unsigned b = ev.button_id;
if (b >= 5) continue;
|