MHeironimus / ArduinoJoystickLibrary

An Arduino library that adds one or more joysticks to the list of HID devices an Arduino Leonardo or Arduino Micro can support.
GNU Lesser General Public License v3.0
2.07k stars 403 forks source link

[FIXED] 8 axes in win 10 #177

Open batbsv opened 3 years ago

batbsv commented 3 years ago

tested on win 10 pro only

Joystick_ Joystick(JOYSTICK_DEFAULT_REPORT_ID, JOYSTICK_TYPE_JOYSTICK, 128, 2, true,//x true, //y true,//z true,//rx true,//ry true,//rz true, //rudder (Slider2) true, //throttle (Slider1) false, //accel false, //brake false //steering );

file Joystick.cpp ---------------old if (includeRudder == true) { // USAGE (Rudder) tempHidReportDescriptor[hidReportDescriptorSize++] = 0x09; tempHidReportDescriptor[hidReportDescriptorSize++] = 0xBA; }


    if (includeRudder == true) {
        // USAGE (Rudder)
        tempHidReportDescriptor[hidReportDescriptorSize++] = 0x09;
        tempHidReportDescriptor[hidReportDescriptorSize++] = 0xBB; change BA to BB
    }

Slider2 available now

Desktop Screenshot 2020 12 17 - 19 29 58 96

batbsv commented 3 years ago

Another way- chande library https://github.com/batbsv/Arduino_Joystick_Keyboard_UARTengine

ttait-vantim commented 3 years ago

Is this related to Issue #44 ?

batbsv commented 3 years ago

yes. additional, device visible in usb game control

Desktop Screenshot 2020 12 18 - 10 00 19 47

theblackhawk76 commented 3 years ago

Maybe try using MMJOY2?

batbsv commented 3 years ago

this issue fixed.work properly mmjoy2 not have source code, and project freezed.

thomasnield commented 3 years ago

Thank you for this.

neilp2 commented 3 years ago

I can confirm this modification works, and makes the Rudder and Throttle present as two throttle inputs in windows Game Controllers panel: USB-GameControllers

I'm using this code to create the joystick with 8 analog inputs:

Joystick_ Joystick(JOYSTICK_DEFAULT_REPORT_ID, 
  JOYSTICK_TYPE_JOYSTICK, 24, 0,          // 24 buttons, no hat switch
  true, true, true, true, true, true,     // X, Y, Z, Xr, Yr, Zr
  true, true, false, false, false);       // Rud, Thr, Acc, Brake, Steer

This is providing a custom controller into Microsoft Flight Simulator 2020 (MSFS 2020). The two Throttles appear as 'slider' inputs Slider X and Slider Y.

MSFS-Custom-inputs

Thank you @MHeironimus for the excellent library.

Aenonar commented 1 year ago

No idea how or why this works but I can confirm that this fix works in DCS as well, thanks a lot!

Screen Shot 11-29-22 at 10 23 PM

(Inverted slider2 is intentional as I was troubleshooting)

jiangfei commented 8 months ago

仅在win 10 pro上测试

操纵杆_操纵杆(操纵杆_默认_报告_ID,操纵杆类型操纵杆,128,2,真,//x真,//y真,//z真,//rx真,//ry真,//rztrue,//rudder (Slider2)true,//throttle (Slider1)false,//accel假,//刹车假//转向 );

文件操纵杆. cpp-旧的if (includeRudder == true) {//用法(方向舵)tempHidReportDescriptor[hidreportdescriptorsize++]= 0x 09;tempHidReportDescriptor[hidreportdescriptorsize++]= 0x ba; }

  if (includeRudder == true) {
      // USAGE (Rudder)
      tempHidReportDescriptor[hidReportDescriptorSize++] = 0x09;
      tempHidReportDescriptor[hidReportDescriptorSize++] = 0xBB; change BA to BB
  }

幻灯片2现已推出

Desktop Screenshot 2020 12 17 - 19 29 58 96

After I changed the contents of the Jostick.cpp file, both throttles can be displayed in the game controller, but slider2 is not recognized in the DCS