Unified LB/RB and black/white handling
This commit is contained in:
parent
54c0b328d1
commit
2f204194b9
5 changed files with 16 additions and 40 deletions
3
NEWS
3
NEWS
|
@ -26,7 +26,8 @@ xboxdrv 0.6.2 - (??/Jan/2011)
|
|||
* added --evdev-no-grab to avoid a full grab on the event device
|
||||
* unified ini and command line parsing some more
|
||||
* Mad Catz Xbox controller - MW2 controller support added
|
||||
* added support for Xbox1 analog buttons
|
||||
* added support for Xbox1 analog buttons, use --ui-axismap with A, B,
|
||||
X, Y, black, white
|
||||
|
||||
|
||||
xboxdrv 0.6.1 - (21/Dec/2010)
|
||||
|
|
|
@ -256,8 +256,8 @@ uInput::send(XboxMsg& msg)
|
|||
send_button(XBOX_BTN_X, msg.x);
|
||||
send_button(XBOX_BTN_Y, msg.y);
|
||||
|
||||
send_button(XBOX_BTN_WHITE, msg.white);
|
||||
send_button(XBOX_BTN_BLACK, msg.black);
|
||||
send_button(XBOX_BTN_LB, msg.white);
|
||||
send_button(XBOX_BTN_RB, msg.black);
|
||||
|
||||
// trigger
|
||||
send_button(XBOX_BTN_LT, msg.lt);
|
||||
|
|
|
@ -88,9 +88,6 @@ uInputCfg::mimic_xpad()
|
|||
get_btn_map().bind(XBOX_BTN_X, ButtonEvent::create_key(BTN_X));
|
||||
get_btn_map().bind(XBOX_BTN_Y, ButtonEvent::create_key(BTN_Y));
|
||||
|
||||
get_btn_map().bind(XBOX_BTN_WHITE, ButtonEvent::create_key(BTN_TL));
|
||||
get_btn_map().bind(XBOX_BTN_BLACK, ButtonEvent::create_key(BTN_TR));
|
||||
|
||||
get_btn_map().bind(XBOX_BTN_LB, ButtonEvent::create_key(BTN_TL));
|
||||
get_btn_map().bind(XBOX_BTN_RB, ButtonEvent::create_key(BTN_TR));
|
||||
|
||||
|
@ -165,9 +162,6 @@ uInputCfg::set_defaults()
|
|||
get_btn_map().bind(XBOX_BTN_X, ButtonEvent::create_key(BTN_X));
|
||||
get_btn_map().bind(XBOX_BTN_Y, ButtonEvent::create_key(BTN_Y));
|
||||
|
||||
get_btn_map().bind(XBOX_BTN_WHITE, ButtonEvent::create_key(BTN_TL));
|
||||
get_btn_map().bind(XBOX_BTN_BLACK, ButtonEvent::create_key(BTN_TR));
|
||||
|
||||
get_btn_map().bind(XBOX_BTN_LB, ButtonEvent::create_key(BTN_TL));
|
||||
get_btn_map().bind(XBOX_BTN_RB, ButtonEvent::create_key(BTN_TR));
|
||||
|
||||
|
|
|
@ -225,10 +225,8 @@ int get_button(XboxGenericMsg& msg, XboxButton button)
|
|||
case XBOX_BTN_X: return msg.xbox360.x;
|
||||
case XBOX_BTN_Y: return msg.xbox360.y;
|
||||
|
||||
case XBOX_BTN_LB:
|
||||
case XBOX_BTN_WHITE: return msg.xbox360.lb;
|
||||
case XBOX_BTN_RB:
|
||||
case XBOX_BTN_BLACK: return msg.xbox360.rb;
|
||||
case XBOX_BTN_LB: return msg.xbox360.lb;
|
||||
case XBOX_BTN_RB: return msg.xbox360.rb;
|
||||
|
||||
case XBOX_BTN_LT: return msg.xbox360.lt;
|
||||
case XBOX_BTN_RT: return msg.xbox360.rt;
|
||||
|
@ -258,13 +256,11 @@ int get_button(XboxGenericMsg& msg, XboxButton button)
|
|||
case XBOX_BTN_X: return msg.xbox.x;
|
||||
case XBOX_BTN_Y: return msg.xbox.y;
|
||||
|
||||
case XBOX_BTN_LB:
|
||||
case XBOX_BTN_WHITE: return msg.xbox.white;
|
||||
case XBOX_BTN_RB:
|
||||
case XBOX_BTN_BLACK: return msg.xbox.black;
|
||||
case XBOX_BTN_LB: return msg.xbox.white;
|
||||
case XBOX_BTN_RB: return msg.xbox.black;
|
||||
|
||||
case XBOX_BTN_LT: return msg.xbox.lt;
|
||||
case XBOX_BTN_RT: return msg.xbox.rt;
|
||||
case XBOX_BTN_LT: return msg.xbox.lt;
|
||||
case XBOX_BTN_RT: return msg.xbox.rt;
|
||||
|
||||
case XBOX_BTN_THUMB_L: return msg.xbox.thumb_l;
|
||||
case XBOX_BTN_THUMB_R: return msg.xbox.thumb_r;
|
||||
|
@ -298,10 +294,8 @@ void set_button(XboxGenericMsg& msg, XboxButton button, bool v)
|
|||
case XBOX_BTN_X: msg.xbox360.x = v; break;
|
||||
case XBOX_BTN_Y: msg.xbox360.y = v; break;
|
||||
|
||||
case XBOX_BTN_LB:
|
||||
case XBOX_BTN_WHITE: msg.xbox360.lb = v; break;
|
||||
case XBOX_BTN_RB:
|
||||
case XBOX_BTN_BLACK: msg.xbox360.rb = v; break;
|
||||
case XBOX_BTN_LB: msg.xbox360.lb = v; break;
|
||||
case XBOX_BTN_RB: msg.xbox360.rb = v; break;
|
||||
|
||||
case XBOX_BTN_LT: msg.xbox360.lt = v*255; break;
|
||||
case XBOX_BTN_RT: msg.xbox360.rt = v*255; break;
|
||||
|
@ -331,10 +325,8 @@ void set_button(XboxGenericMsg& msg, XboxButton button, bool v)
|
|||
case XBOX_BTN_X: msg.xbox.x = v; break;
|
||||
case XBOX_BTN_Y: msg.xbox.y = v; break;
|
||||
|
||||
case XBOX_BTN_LB:
|
||||
case XBOX_BTN_WHITE: msg.xbox.white = v; break;
|
||||
case XBOX_BTN_RB:
|
||||
case XBOX_BTN_BLACK: msg.xbox.black = v; break;
|
||||
case XBOX_BTN_LB: msg.xbox.white = v; break;
|
||||
case XBOX_BTN_RB: msg.xbox.black = v; break;
|
||||
|
||||
case XBOX_BTN_LT: msg.xbox.lt = v; break;
|
||||
case XBOX_BTN_RT: msg.xbox.rt = v; break;
|
||||
|
@ -912,14 +904,9 @@ XboxButton string2btn(const std::string& str_)
|
|||
else if (str == "y" || str == "4" || str == "yellow")
|
||||
return XBOX_BTN_Y;
|
||||
|
||||
else if (str == "black")
|
||||
return XBOX_BTN_BLACK;
|
||||
else if (str == "white")
|
||||
return XBOX_BTN_WHITE;
|
||||
|
||||
else if (str == "lb" || str == "5" || str == "orange")
|
||||
else if (str == "lb" || str == "5" || str == "orange" || str == "white")
|
||||
return XBOX_BTN_LB;
|
||||
else if (str == "rb" || str == "6")
|
||||
else if (str == "rb" || str == "6" || str == "black")
|
||||
return XBOX_BTN_RB;
|
||||
|
||||
else if (str == "lt" || str == "7")
|
||||
|
@ -1040,9 +1027,6 @@ std::string btn2string(XboxButton btn)
|
|||
case XBOX_BTN_X: return "X";
|
||||
case XBOX_BTN_Y: return "Y";
|
||||
|
||||
case XBOX_BTN_WHITE: return "White";
|
||||
case XBOX_BTN_BLACK: return "Black";
|
||||
|
||||
case XBOX_BTN_LB: return "LB";
|
||||
case XBOX_BTN_RB: return "RB";
|
||||
|
||||
|
|
|
@ -149,9 +149,6 @@ enum XboxButton {
|
|||
XBOX_BTN_X,
|
||||
XBOX_BTN_Y,
|
||||
|
||||
XBOX_BTN_WHITE,
|
||||
XBOX_BTN_BLACK,
|
||||
|
||||
XBOX_BTN_LB,
|
||||
XBOX_BTN_RB,
|
||||
|
||||
|
|
Loading…
Reference in a new issue