Пример #1
0
void
SplitAxisModifier::init(ControllerMessageDescriptor& desc)
{
  m_axis = desc.abs().get(m_axis_str);
  m_out_lhs = desc.abs().get(m_out_lhs_str);
  m_out_rhs = desc.abs().get(m_out_rhs_str);
}
Пример #2
0
void
Acc2AxisModifier::init(ControllerMessageDescriptor& desc)
{
  m_acc_x = desc.abs().get(m_acc_x_str);
  m_acc_y = desc.abs().get(m_acc_y_str);
  m_acc_z = desc.abs().get(m_acc_z_str);

  m_axis_x = desc.abs().getput(m_axis_x_str);
  m_axis_y = desc.abs().getput(m_axis_y_str);
}
Пример #3
0
void
Button2AxisModifier::init(ControllerMessageDescriptor& desc)
{
  m_lhs_btn = desc.key().get(m_lhs_btn_str);
  m_rhs_btn = desc.key().get(m_rhs_btn_str);
  m_axis = desc.abs().get(m_axis_str);
}
Пример #4
0
void
CompatModifier::init(ControllerMessageDescriptor& desc)
{
  log_tmp("CompatModifier");

#if 0
  // have a dpad, but no dpad axis
  if (!desc.abs().has(AbsName("gamepad.dpad_x")) && 
      !desc.abs().has(AbsName("gamepad.dpad_y")) &&
      desc.key().has(KeyName("gamepad.dpad_up")) &&
      desc.key().has(KeyName("gamepad.dpad_down")) &&
      desc.key().has(KeyName("gamepad.dpad_left")) &&
      desc.key().has(KeyName("gamepad.dpad_right")))
  {
    log_tmp("CompatModifier: DPAD");
    m_dpad_x = desc.abs().put("dpad_x");
    m_dpad_y = desc.abs().put("dpad_y");

    m_dpad_up    = desc.key().get("du");
    m_dpad_down  = desc.key().get("dd");
    m_dpad_left  = desc.key().get("dl");
    m_dpad_right = desc.key().get("dr");

    m_dpad = true;
  }

  // make a rudder out of both trigger
  if (!desc.abs().has("trigger") &&
      desc.abs().has("lt") &&
      desc.abs().has("rt"))
  {
    m_abs_trigger = desc.abs().put("trigger");
    m_lt = desc.abs().get("lt");
    m_rt = desc.abs().get("rt");

    m_trigger = true;
  }
#endif
}
Пример #5
0
Xbox360DefaultNames::Xbox360DefaultNames(ControllerMessageDescriptor& desc) :
  btn_a(-1),
  btn_b(-1),
  btn_x(-1),
  btn_y(-1),
  btn_start(-1),
  btn_guide(-1),
  btn_back(-1),
  btn_thumb_l(-1),
  btn_thumb_r(-1),
  btn_lb(-1),
  btn_rb(-1),
  btn_lt(-1),
  btn_rt(-1),
  dpad_up(-1),
  dpad_down(-1),
  dpad_left(-1),
  dpad_right(-1),
  abs_x1(-1),
  abs_y1(-1),
  abs_x2(-1),
  abs_y2(-1),
  abs_lt(-1),
  abs_rt(-1),
  abs_a(-1),
  abs_b(-1),
  abs_x(-1),
  abs_y(-1),
  abs_black(-1),
  abs_white(-1)
{
#if 0
  else if (str == "trigger" || str == "z" || str == "rudder")
    return XBOX_AXIS_TRIGGER;
#endif

  btn_a = desc.key().put(KeyName("xbox.a"));
  btn_b = desc.key().put(KeyName("xbox.b"));
  btn_x = desc.key().put(KeyName("xbox.x"));
  btn_y = desc.key().put(KeyName("xbox.y"));

  btn_start = desc.key().put(KeyName("xbox.start"));
  btn_guide = desc.key().put(KeyName("xbox.guide"));
  btn_back  = desc.key().put(KeyName("xbox.back"));

  btn_lb = desc.key().put(KeyName("xbox.lb"));
  btn_rb = desc.key().put(KeyName("xbox.rb"));

  btn_lt = desc.key().put(KeyName("xbox.lt"));
  btn_rt = desc.key().put(KeyName("xbox.rt"));

  btn_thumb_l = desc.key().put(KeyName("xbox.thumb_l"));
  btn_thumb_r = desc.key().put(KeyName("xbox.thumb_r"));

  dpad_up    = desc.key().put(KeyName("xbox.dpad_up"));
  dpad_down  = desc.key().put(KeyName("xbox.dpad_down"));
  dpad_left  = desc.key().put(KeyName("xbox.dpad_left"));
  dpad_right = desc.key().put(KeyName("xbox.dpad_right"));

  abs_x1 = desc.abs().put(AbsName("xbox.x1"));
  abs_y1 = desc.abs().put(AbsName("xbox.y1"));
  abs_x2 = desc.abs().put(AbsName("xbox.x2"));
  abs_y2 = desc.abs().put(AbsName("xbox.y2"));

  abs_lt = desc.abs().put(AbsName("xbox.lt"));
  abs_rt = desc.abs().put(AbsName("xbox.rt"));

  abs_a = desc.abs().put(AbsName("xbox.a"));
  abs_b = desc.abs().put(AbsName("xbox.b"));
  abs_x = desc.abs().put(AbsName("xbox.x"));
  abs_y = desc.abs().put(AbsName("xbox.y"));

  abs_black = desc.abs().put(AbsName("xbox.black"));
  abs_white = desc.abs().put(AbsName("xbox.white"));
}
Пример #6
0
WiiNames::WiiNames(ControllerMessageDescriptor& desc) :
  plus(-1),
  home(-1),
  minus(-1),

  a(-1),
  b(-1),
  btn1(-1),
  btn2(-1),

  dpad_up(-1),
  dpad_down(-1),
  dpad_left(-1),
  dpad_right(-1),

  acc_x(-1),
  acc_y(-1),
  acc_z(-1),

  ir1_x(-1),
  ir1_y(-1),
  ir1_size(-1),

  ir2_x(-1),
  ir2_y(-1),
  ir2_size(-1),

  ir3_x(-1),
  ir3_y(-1),
  ir3_size(-1),

  ir4_x(-1),
  ir4_y(-1),
  ir4_size(-1),

  nunchuk_x(-1),
  nunchuk_y(-1),

  nunchuk_c(-1),
  nunchuk_z(-1),

  nunchuk_acc_x(-1),
  nunchuk_acc_y(-1),
  nunchuk_acc_z(-1)
{
  minus = desc.key().put(KeyName("wiimote.minus"));
  home  = desc.key().put(KeyName("wiimote.home"));
  plus  = desc.key().put(KeyName("wiimote.plus"));
  
  a = desc.key().put(KeyName("wiimote.a"));
  b = desc.key().put(KeyName("wiimote.b"));
  btn1 = desc.key().put(KeyName("wiimote.1"));
  btn2 = desc.key().put(KeyName("wiimote.2"));

  dpad_up    = desc.key().put(KeyName("wiimote.dpad_up"));
  dpad_down  = desc.key().put(KeyName("wiimote.dpad_down"));
  dpad_left  = desc.key().put(KeyName("wiimote.dpad_left"));
  dpad_right = desc.key().put(KeyName("wiimote.dpad_right"));

  acc_x = desc.abs().put(AbsName("wiimote.acc_x"));
  acc_y = desc.abs().put(AbsName("wiimote.acc_y"));
  acc_z = desc.abs().put(AbsName("wiimote.acc_z"));

  ir1_x = desc.abs().put(AbsName("wiimote.ir1_x"));
  ir1_y = desc.abs().put(AbsName("wiimote.ir1_y"));
  ir1_size = desc.abs().put(AbsName("wiimote.ir1_size"));

  ir2_x = desc.abs().put(AbsName("wiimote.ir2_x"));
  ir2_y = desc.abs().put(AbsName("wiimote.ir2_y"));
  ir2_size = desc.abs().put(AbsName("wiimote.ir2_size"));

  ir3_x = desc.abs().put(AbsName("wiimote.ir3_x"));
  ir3_y = desc.abs().put(AbsName("wiimote.ir3_y"));
  ir3_size = desc.abs().put(AbsName("wiimote.ir3_size"));

  ir4_x = desc.abs().put(AbsName("wiimote.ir4_x"));
  ir4_y = desc.abs().put(AbsName("wiimote.ir4_y"));
  ir4_size = desc.abs().put(AbsName("wiimote.ir4_size"));

  nunchuk_x = desc.abs().put(AbsName("nunchuk.x1"));
  nunchuk_y = desc.abs().put(AbsName("nunchuk.y1"));

  nunchuk_c = desc.key().put(KeyName("nunchuk.c"));
  nunchuk_z = desc.key().put(KeyName("nunchuk.z"));

  nunchuk_acc_x = desc.abs().put(AbsName("nunchuk.acc_x"));
  nunchuk_acc_y = desc.abs().put(AbsName("nunchuk.acc_x"));
  nunchuk_acc_z = desc.abs().put(AbsName("nunchuk.acc_y"));
}
Пример #7
0
 void init(ControllerMessageDescriptor& desc)
 {
   m_abs = desc.abs().getput(get_name());
 }
Пример #8
0
void
RotateAxisModifier::init(ControllerMessageDescriptor& desc)
{
    m_xaxis = desc.abs().get(m_xaxis_str);
    m_yaxis = desc.abs().get(m_yaxis_str);
}