From f23c07b413130f28363b82c68b001721b66a451e Mon Sep 17 00:00:00 2001 From: Adam777 Date: Thu, 22 Jul 2021 21:35:31 +0000 Subject: [PATCH] Update --- XboxGuideButtonMapToKey.vcxproj | 11 ++++++----- main.cpp | 8 ++++++++ resource.rc | Bin 4890 -> 4904 bytes x64/Release/config.ini | 6 +++--- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/XboxGuideButtonMapToKey.vcxproj b/XboxGuideButtonMapToKey.vcxproj index 8131e6f..333267b 100644 --- a/XboxGuideButtonMapToKey.vcxproj +++ b/XboxGuideButtonMapToKey.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -22,27 +22,28 @@ {1A08601A-0971-4A8F-AE2B-CF6184D01CDD} Win32Proj XboxGuideButtonMapToKey + 10.0.17763.0 Application true - v140 + v141 Application false - v140 + v141 Application true - v140 + v141 Application false - v140 + v141 diff --git a/main.cpp b/main.cpp index 81a9058..41e857d 100644 --- a/main.cpp +++ b/main.cpp @@ -143,9 +143,13 @@ struct GlobalData XInputGetStateEx(i, &states[i]); if ((is_guide_down(states[i])) && (!wasGuideDownPrev[i])) + { guidePressed.call(i); + } else if ((!is_guide_down(states[i])) && (wasGuideDownPrev[i])) + { guideReleased.call(i); + } wasGuideDownPrev[i] = is_guide_down(states[i]); } @@ -171,13 +175,17 @@ struct GlobalData dll = LoadLibrary(dll_path); if (!dll) + { fatal_error("Error loading XInput DLL."); + } XInputGetStateEx = (XInputGetStateEx_t)GetProcAddress(dll, (LPCSTR)100); handy::io::INIFile ini; if (!ini.loadFile("config.ini")) + { fatal_error("Couldn't load config.ini"); + } settings[0].key = ini.getInteger("player1", "key", 27); settings[0].hold_mode = ini.getInteger("player1", "hold_mode", 1); diff --git a/resource.rc b/resource.rc index 35da8cc7757564b0097efbdf2165cf8156a62b99..5a37c93d699b10f5b6e664017eeb9444790ac813 100644 GIT binary patch delta 63 zcmbQGwnA;g9L~uZ>>DO~a8)rHPCm?K$Y{9vE7xKsRzn6o27}3he7ciQ@p^FTG8i!! SFc>me0!3~EmAvKCWdQ(v&JqRy delta 62 zcmZ3XHcM^89L~vH%!?-Tad1uc;i_UZn0%bekkMfCPp-vGK+as=%E^oPtR_eCEnqfa S(3?D;M{=?TztCb0eii_Lwi5pU diff --git a/x64/Release/config.ini b/x64/Release/config.ini index ec9ea74..afb7c91 100644 --- a/x64/Release/config.ini +++ b/x64/Release/config.ini @@ -9,12 +9,12 @@ key = 27 ; will be ignored- simple as that. If 2, "key" will be briefly tapped if guide is ; held for less than longpress_duration, and longpress_key will be briefly tapped ; if the guide is held for longer than that. -; Note that even after the guide button has been held for loner than longpress_duration, +; Note that even after the guide button has been held for longer than longpress_duration, ; you still need to release it before anything will be sent. hold_mode = 1 -; See above. Default is 112 (F1). -longpress_key = 112 +; See above. Default is 27 (escape). +longpress_key = 27 ; See above. In milliseconds (1000 = 1 second) longpress_duration = 1000