@@ -127,6 +127,7 @@ bool StartupDeleteEntry()
127
127
// lower 12 bits are controller index into XboxController::controllers_
128
128
#define ID_CONTROLLER_GUIDEBTN 0x2000
129
129
#define ID_CONTROLLER_VIBRATION 0x4000
130
+ #define ID_CONTROLLER_REMAP 0x8000
130
131
131
132
WCHAR tray_text[128 ];
132
133
@@ -178,6 +179,12 @@ void SysTrayShowContextMenu()
178
179
InsertMenuA (hControllerMenu, 0xFFFFFFFF , MF_BYPOSITION | MF_STRING | MF_GRAYED, ID_TRAY_SEP, combo.c_str ());
179
180
}
180
181
182
+ InsertMenu (hControllerMenu, 0xFFFFFFFF , MF_BYPOSITION | MF_STRING |
183
+ (controller.RemapEnabled () ? MF_CHECKED : MF_UNCHECKED), ID_CONTROLLER_REMAP + i, L" Enable button remappings" );
184
+
185
+ auto remapCount = " - " + std::to_string (controller.Settings ().button_remap .size ()) + " buttons remapped" ;
186
+ InsertMenuA (hControllerMenu, 0xFFFFFFFF , MF_BYPOSITION | MF_STRING | MF_GRAYED, ID_TRAY_SEP, remapCount.c_str ());
187
+
181
188
InsertMenu (hControllerMenu, 0xFFFFFFFF , MF_SEPARATOR, ID_TRAY_SEP, L" SEP" );
182
189
183
190
// Insert current deadzone adjustments into context menu
@@ -233,7 +240,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
233
240
case WM_COMMAND:
234
241
wmId = LOWORD (wParam);
235
242
236
- if (wmId & ID_CONTROLLER_GUIDEBTN || wmId & ID_CONTROLLER_VIBRATION)
243
+ if (wmId & ID_CONTROLLER_GUIDEBTN || wmId & ID_CONTROLLER_VIBRATION || wmId & ID_CONTROLLER_REMAP )
237
244
{
238
245
auto controllerId = wmId & 0xFFF ;
239
246
auto & pads = XboxController::GetControllers ();
@@ -244,6 +251,8 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
244
251
controller.GuideEnabled (!controller.GuideEnabled ());
245
252
if (wmId & ID_CONTROLLER_VIBRATION)
246
253
controller.VibrationEnabled (!controller.VibrationEnabled ());
254
+ if (wmId & ID_CONTROLLER_REMAP)
255
+ controller.RemapEnabled (!controller.RemapEnabled ());
247
256
}
248
257
}
249
258
else
0 commit comments