|
From: knittl <kn...@us...> - 2009-08-03 08:41:33
|
Module: performous
Branch: master
Commit: 17026d20a40faf00f86b738d828cc58d5d6d350e
Author: Vincent Le Ligeour <yo...@us...>
Date: Mon Aug 3 00:05:40 2009 +0200
Fixed typo
Added shift picking
---
game/joystick.cc | 10 +++++++++-
game/joystick.hh | 4 ++--
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/game/joystick.cc b/game/joystick.cc
index cfdd816..134498c 100644
--- a/game/joystick.cc
+++ b/game/joystick.cc
@@ -138,7 +138,15 @@ bool input::pushEvent(SDL_Event _e) {
switch(_e.key.keysym.sym) {
case SDLK_RETURN:
event.type = input::Event::PICK;
- button = 0;
+ event.button = 1;
+ for( unsigned int i = 0 ; i < BUTTONS ; ++i ) {
+ event.pressed[i] = devices[joy_id].pressed(i);
+ }
+ devices[joy_id].addEvent(event);
+ return true;
+ case SDLK_RSHIFT:
+ event.type = input::Event::PICK;
+ event.button = 0;
for( unsigned int i = 0 ; i < BUTTONS ; ++i ) {
event.pressed[i] = devices[joy_id].pressed(i);
}
diff --git a/game/joystick.hh b/game/joystick.hh
index 98ddebf..7a4c3c3 100644
--- a/game/joystick.hh
+++ b/game/joystick.hh
@@ -93,9 +93,9 @@ namespace input {
InputDev(input::DevType _type) {
using namespace input::Private;
if( _type == input::DRUMS )
- std::cout << "Request aquiring DRUM" << std::endl;
+ std::cout << "Request acquiring DRUM" << std::endl;
if( _type == input::GUITAR )
- std::cout << "Request aquiring GUITAR" << std::endl;
+ std::cout << "Request acquiring GUITAR" << std::endl;
if( devices.size() == 0 ) throw std::runtime_error("No InputDev available");
for(InputDevs::iterator it = devices.begin() ; it != devices.end() ; ++it) {
if( !it->second.assigned() && it->second.type_match(_type) ) {
|