|
From: Tapio V. <aa...@us...> - 2010-08-21 18:03:11
|
Module: performous
Branch: master
Commit: 95fa380393074aa4049580103b43d3c81ac6a423
Author: Tapio Vierros <tap...@gm...>
Date: Thu Jul 8 18:40:57 2010 +0300
Modify instrument menu navigation.
---
game/guitargraph.cc | 10 +++++-----
game/joystick.cc | 2 +-
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 75746bd..bf62484 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -283,11 +283,11 @@ void GuitarGraph::engine() {
if (menuOpen()) {
bool old_lefty = m_leftymode.b();
// Check first regular keys
- if (ev.type == input::Event::PRESS && ev.button == 0 + m_drums) m_menu.action(1);
- else if (ev.type == input::Event::PRESS && ev.button == 1 + m_drums) m_menu.action(-1);
- else if (ev.type == input::Event::PRESS && ev.button == 2 + m_drums) m_menu.move(1);
- else if (ev.type == input::Event::PRESS && ev.button == 3 + m_drums) m_menu.move(-1);
- // Strum
+ if (ev.type == input::Event::PRESS && ev.button == 0) m_menu.action(1);
+ else if (ev.type == input::Event::PRESS && ev.button == (m_drums ? 4 : 1)) m_menu.action(-1);
+ else if (ev.type == input::Event::PRESS && ev.button == (m_drums ? 1 : 2)) m_menu.move(1);
+ else if (ev.type == input::Event::PRESS && ev.button == (m_drums ? 2 : 3)) m_menu.move(-1);
+ // Strum (strum of keyboard as guitar doesn't generate nav-events)
else if (ev.type == input::Event::PICK && ev.button == 0) m_menu.move(1);
else if (ev.type == input::Event::PICK && ev.button == 1) m_menu.move(-1);
else { // Try nav keys (arrows)
diff --git a/game/joystick.cc b/game/joystick.cc
index 08661fb..82e65a1 100644
--- a/game/joystick.cc
+++ b/game/joystick.cc
@@ -482,7 +482,7 @@ bool input::SDL::pushEvent(SDL_Event _e) {
if (pickPressed[1]) return true; // repeating
pickPressed[1] = true;
event.type = input::Event::PICK;
- button = 0;
+ button = 1;
is_guitar_event = true;
break;
case SDLK_BACKSPACE:
|