diff --git a/src/boilerplate.c b/src/boilerplate.c index 7300793..4360e7a 100644 --- a/src/boilerplate.c +++ b/src/boilerplate.c @@ -1,5 +1,8 @@ #include "helpers.h" +// force show cursor +HOOK_DYNAMIC (i32, __stdcall, ShowMouse, i32 show) { return originalShowMouse (true); } + // xinput stuff HOOK_DYNAMIC (u32, __stdcall, XinputGetState, u32 index, void *state) { return ERROR_DEVICE_NOT_CONNECTED; } HOOK_DYNAMIC (u32, __stdcall, XinputSetState, u32 index, void *state) { return ERROR_DEVICE_NOT_CONNECTED; } @@ -54,6 +57,7 @@ HOOK_DYNAMIC (i64, __fastcall, UsbFinderGetSerialNumber, i32 a1, i64 a2) { retur void init_boilerplate () { + INSTALL_HOOK_DYNAMIC (ShowMouse, PROC_ADDRESS ("user32.dll", "ShowCursor")); INSTALL_HOOK_DYNAMIC (XinputGetState, PROC_ADDRESS ("xinput9_1_0.dll", "XInputGetState")); INSTALL_HOOK_DYNAMIC (XinputSetState, PROC_ADDRESS ("xinput9_1_0.dll", "XInputSetState")); INSTALL_HOOK_DYNAMIC (XinputGetCapabilites, PROC_ADDRESS ("xinput9_1_0.dll", "XInputGetCapabilities")); diff --git a/src/dllmain.c b/src/dllmain.c index 8225a90..83429df 100644 --- a/src/dllmain.c +++ b/src/dllmain.c @@ -2,9 +2,6 @@ #include "helpers.h" #include "poll.h" -// force show cursor -HOOK_DYNAMIC (i32, __stdcall, ShowMouse, i32 show) { return originalShowMouse (true); } - bool testEnabled = false; u16 drumMax = 0xFFFF; u16 drumMin = 0xFFFF; @@ -12,16 +9,16 @@ u16 drumMin = 0xFFFF; #define ON_HIT(bind) IsButtonTapped (bind) ? drumMax == drumMin ? drumMax : (u16)(rand () % drumMax + drumMin) : 0 Keybindings EXIT = { .keycodes = { VK_ESCAPE } }; -Keybindings COIN_ADD = { .keycodes = { VK_RETURN }, .buttons = { SDL_CONTROLLER_BUTTON_START } }; Keybindings TEST = { .keycodes = { VK_F1 } }; Keybindings SERVICE = { .keycodes = { VK_F2 } }; Keybindings DEBUG_UP = { .keycodes = { VK_UP } }; Keybindings DEBUG_DOWN = { .keycodes = { VK_DOWN } }; Keybindings DEBUG_ENTER = { .keycodes = { VK_RETURN } }; -Keybindings P1_LEFT_BLUE = { .keycodes = { 'D' } }; -Keybindings P1_LEFT_RED = { .keycodes = { 'F' } }; -Keybindings P1_RIGHT_RED = { .keycodes = { 'J' } }; -Keybindings P1_RIGHT_BLUE = { .keycodes = { 'K' } }; +Keybindings COIN_ADD = { .keycodes = { VK_RETURN }, .buttons = { SDL_CONTROLLER_BUTTON_START } }; +Keybindings P1_LEFT_BLUE = { .keycodes = { 'D' }, .axis = { SDL_AXIS_LTRIGGER_DOWN } }; +Keybindings P1_LEFT_RED = { .keycodes = { 'F' }, .buttons = { SDL_CONTROLLER_BUTTON_LEFTSTICK } }; +Keybindings P1_RIGHT_RED = { .keycodes = { 'J' }, .buttons = { SDL_CONTROLLER_BUTTON_RIGHTSTICK } }; +Keybindings P1_RIGHT_BLUE = { .keycodes = { 'K' }, .axis = { SDL_AXIS_RTRIGGER_DOWN } }; Keybindings P2_LEFT_BLUE = {}; Keybindings P2_LEFT_RED = {}; Keybindings P2_RIGHT_RED = {};