ArduinoJoystickLibrary icon indicating copy to clipboard operation
ArduinoJoystickLibrary copied to clipboard

[FIXED] 8 axes in win 10

Open batbsv opened this issue 4 years ago • 9 comments

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 avatar Dec 17 '20 10:12 batbsv

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

batbsv avatar Dec 17 '20 14:12 batbsv

Is this related to Issue #44 ?

ttait-vantim avatar Dec 17 '20 20:12 ttait-vantim

yes. additional, device visible in usb game control

Desktop Screenshot 2020 12 18 - 10 00 19 47

batbsv avatar Dec 18 '20 01:12 batbsv

Maybe try using MMJOY2?

theblackhawk76 avatar Jan 26 '21 07:01 theblackhawk76

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

batbsv avatar Jan 26 '21 10:01 batbsv

Thank you for this.

thomasnield avatar Feb 12 '21 15:02 thomasnield

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.

neilp2 avatar Feb 28 '21 09:02 neilp2

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)

Aenonar avatar Nov 29 '22 21:11 Aenonar

仅在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

jiangfei avatar Oct 13 '23 02:10 jiangfei