diff --git a/src/usb-pad/dx/dinput-config.cpp b/src/usb-pad/dx/dinput-config.cpp index 3f580582..11e86134 100644 --- a/src/usb-pad/dx/dinput-config.cpp +++ b/src/usb-pad/dx/dinput-config.cpp @@ -955,6 +955,13 @@ INT_PTR CALLBACK DxDialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam TestForce(s->port); } break; + case IDC_DELALL: + { + for (int i = 0; i < CID_COUNT; i++) { + DeleteControl(s->port, (ControlID)i); + } + } + break; case IDC_ASS0: { StartListen(CID_STEERING); break; } case IDC_ASS1: { StartListen(CID_STEERING_R); break; } diff --git a/src/usb-pad/dx/versionproxy.h b/src/usb-pad/dx/versionproxy.h index 142c9050..58b75289 100644 --- a/src/usb-pad/dx/versionproxy.h +++ b/src/usb-pad/dx/versionproxy.h @@ -192,6 +192,7 @@ #define IDC_ASS29 1157 #define IDC_LABEL30 1158 #define IDC_ASS30 1159 +#define IDC_DELALL 1160 // Next default values for new objects // diff --git a/src/usb-pad/dx/versionproxy.rc b/src/usb-pad/dx/versionproxy.rc index afbd758f..2c646479 100644 --- a/src/usb-pad/dx/versionproxy.rc +++ b/src/usb-pad/dx/versionproxy.rc @@ -299,7 +299,7 @@ END IDD_DLG_KEYBOARDMANIA DIALOGEX 0, 0, 580, 160 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Keyboardmania device" +CAPTION "Keyboardmania controller" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN GROUPBOX "Buttons",IDC_STATIC,5,5,140,50 @@ -307,7 +307,6 @@ BEGIN PUSHBUTTON "Select",IDC_ASS14,90,35,50,15 LTEXT "1/1/1/1",IDC_LABEL22,10,17,50,8 LTEXT "1/1/1/1",IDC_LABEL14,10,37,50,8 - GROUPBOX "Wheel",IDC_STATIC,150,5,140,50 PUSHBUTTON "Up",IDC_ASS29,235,15,50,15 PUSHBUTTON "Down",IDC_ASS30,235,35,50,15 @@ -327,19 +326,6 @@ BEGIN PUSHBUTTON "A 1",IDC_ASS10,210,95,40,15 PUSHBUTTON "A# 1",IDC_ASS11,230,80,40,15 PUSHBUTTON "B 1",IDC_ASS12,250,95,40,15 - LTEXT "1/1/1/1",IDC_LABEL0,10,110,38,8 - LTEXT "1/1/1/1",IDC_LABEL1,30,70,38,8 - LTEXT "1/1/1/1",IDC_LABEL2,50,110,38,8 - LTEXT "1/1/1/1",IDC_LABEL3,70,70,38,8 - LTEXT "1/1/1/1",IDC_LABEL4,90,110,38,8 - LTEXT "1/1/1/1",IDC_LABEL5,130,110,38,8 - LTEXT "1/1/1/1",IDC_LABEL6,150,70,38,8 - LTEXT "1/1/1/1",IDC_LABEL8,170,110,38,8 - LTEXT "1/1/1/1",IDC_LABEL9,190,70,38,8 - LTEXT "1/1/1/1",IDC_LABEL10,210,110,38,8 - LTEXT "1/1/1/1",IDC_LABEL11,230,70,38,8 - LTEXT "1/1/1/1",IDC_LABEL12,250,110,38,8 - PUSHBUTTON "C 2",IDC_ASS13,290,95,40,15 PUSHBUTTON "C# 2",IDC_ASS16,310,80,40,15 PUSHBUTTON "D 2",IDC_ASS17,330,95,40,15 @@ -352,6 +338,18 @@ BEGIN PUSHBUTTON "A 2",IDC_ASS26,490,95,40,15 PUSHBUTTON "A# 2",IDC_ASS27,510,80,40,15 PUSHBUTTON "B 2",IDC_ASS28,530,95,40,15 + LTEXT "1/1/1/1",IDC_LABEL0,10,110,38,8 + LTEXT "1/1/1/1",IDC_LABEL1,30,70,38,8 + LTEXT "1/1/1/1",IDC_LABEL2,50,110,38,8 + LTEXT "1/1/1/1",IDC_LABEL3,70,70,38,8 + LTEXT "1/1/1/1",IDC_LABEL4,90,110,38,8 + LTEXT "1/1/1/1",IDC_LABEL5,130,110,38,8 + LTEXT "1/1/1/1",IDC_LABEL6,150,70,38,8 + LTEXT "1/1/1/1",IDC_LABEL8,170,110,38,8 + LTEXT "1/1/1/1",IDC_LABEL9,190,70,38,8 + LTEXT "1/1/1/1",IDC_LABEL10,210,110,38,8 + LTEXT "1/1/1/1",IDC_LABEL11,230,70,38,8 + LTEXT "1/1/1/1",IDC_LABEL12,250,110,38,8 LTEXT "1/1/1/1",IDC_LABEL13,290,110,38,8 LTEXT "1/1/1/1",IDC_LABEL16,310,70,38,8 LTEXT "1/1/1/1",IDC_LABEL17,330,110,38,8 @@ -365,6 +363,7 @@ BEGIN LTEXT "1/1/1/1",IDC_LABEL27,510,70,38,8 LTEXT "1/1/1/1",IDC_LABEL28,530,110,38,8 + PUSHBUTTON "Reset all",IDC_DELALL,5,140,50,15 DEFPUSHBUTTON "OK",IDOK,470,140,50,15 PUSHBUTTON "Cancel",IDCANCEL,525,140,50,15 END diff --git a/src/usb-pad/usb-pad.cpp b/src/usb-pad/usb-pad.cpp index 1f2634db..6b44c796 100644 --- a/src/usb-pad/usb-pad.cpp +++ b/src/usb-pad/usb-pad.cpp @@ -413,12 +413,11 @@ void pad_copy_data(PS2WheelTypes type, uint8_t *buf, wheel_data_t &data) break; case WT_KEYBOARDMANIA_CONTROLLER: - // I don't know what I'm doing buf[0] = 0x3F; buf[1] = data.buttons & 0xFF; buf[2] = (data.buttons >> 8) & 0xFF; - buf[3] = (data.buttons >> 16) & 0xFF; // ? - buf[4] = (data.buttons >> 24) & 0xFF; // ? + buf[3] = (data.buttons >> 16) & 0xFF; + buf[4] = (data.buttons >> 24) & 0xFF; break; default: @@ -809,8 +808,6 @@ USBDevice* KeyboardmaniaDevice::CreateDevice(int port) s->desc.full = &s->desc_dev; s->desc.str = kbm_desc_strings; - // Wtf? - if (usb_desc_parse_dev(kbm_dev_descriptor, sizeof(kbm_dev_descriptor), s->desc, s->desc_dev) < 0) goto fail; if (usb_desc_parse_config(kbm_config_descriptor, sizeof(kbm_config_descriptor), s->desc_dev) < 0)