Skip to content

Commit

Permalink
Fixed INI parser not returning to the start of the INI to scan for ma…
Browse files Browse the repository at this point in the history
…cros after looking for plug-ins to load. (i.e. macros in SpecialK.ini or dxgi.ini being ignored)
  • Loading branch information
Kaldaien committed Nov 9, 2024
1 parent d446335 commit 1cc5c8e
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 9 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
24.11.5.1
24.11.9
=======
+ Fixed INI parser not returning to the start of the INI to scan for macros
after looking for plug-ins to load.
(i.e. macros in SpecialK.ini or dxgi.ini being ignored)

24.11.5.1
=========
+ Detect local ReShade DLLs as ReShade, and allow pressing the default
ReShade UI toggle keybind to work even if SK is blocking keyboard input
Expand Down
6 changes: 3 additions & 3 deletions include/SpecialK/DLL_VERSION.H
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

#define SK_YEAR 24
#define SK_MONTH 11
#define SK_DATE 5
#define SK_REV_N 1
#define SK_REV 1
#define SK_DATE 9
#define SK_REV_N 0
#define SK_REV 0

#ifndef _A2
#define _A2(a) #a
Expand Down
2 changes: 2 additions & 0 deletions include/SpecialK/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -1147,6 +1147,7 @@ struct sk_config_t
bool catch_alt_f4 = true;
bool override_alt_f4 = false; // For games that have prompts (i.e. DQ XI / Yakuza)
int disabled_to_game = 2; //0 = Never, 1 = Always, 2 = In Background
int org_disabled_to_game= 2;
volatile
UINT64 temporarily_allow = 0; // Up until temporarily_allow + 1 frames,
} keyboard; // ignore "disabled_to_game"
Expand All @@ -1160,6 +1161,7 @@ struct sk_config_t
//
bool fix_synaptics = false;
int disabled_to_game = 0; //0 = Never, 1 = Always, 2 = In Background
int org_disabled_to_game= 0;
UINT64 temporarily_allow = 0; // Up until temporarily_allow + 1 frames,
// ignore "disabled_to_game"
bool ignore_small_clips = false;// Ignore mouse clipping rects < 75% the
Expand Down
13 changes: 10 additions & 3 deletions src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2224,6 +2224,7 @@ auto DeclKeybind =
dll_ini->import_file (custom_name.c_str ());
}

sec = sections.cbegin ();

SK_RunOnce (
while (sec != sections.cend ())
Expand Down Expand Up @@ -2321,6 +2322,8 @@ auto DeclKeybind =
}
);

sec = sections.cbegin ();

while (sec != sections.cend ())
{
if (sec->first.find (L"Macro.") != std::wstring::npos)
Expand Down Expand Up @@ -4631,9 +4634,13 @@ auto DeclKeybind =

input.keyboard.catch_alt_f4->load (config.input.keyboard.catch_alt_f4);
input.keyboard.bypass_alt_f4->load (config.input.keyboard.override_alt_f4);
input.keyboard.disabled_to_game->load (config.input.keyboard.disabled_to_game);
input.keyboard.disabled_to_game->load (config.input.keyboard.org_disabled_to_game);
config.input.keyboard.
org_disabled_to_game= config.input.keyboard.org_disabled_to_game;

input.mouse.disabled_to_game->load (config.input.mouse.disabled_to_game);
config.input.mouse.
org_disabled_to_game = config.input.mouse.disabled_to_game;

input.cursor.manage->load (config.input.cursor.manage);
input.cursor.keys_activate->load (config.input.cursor.keys_activate);
Expand Down Expand Up @@ -6093,9 +6100,9 @@ SK_SaveConfig ( std::wstring name,

input.keyboard.catch_alt_f4->store (config.input.keyboard.catch_alt_f4);
input.keyboard.bypass_alt_f4->store (config.input.keyboard.override_alt_f4);
input.keyboard.disabled_to_game->store (config.input.keyboard.disabled_to_game);
input.keyboard.disabled_to_game->store (config.input.keyboard.org_disabled_to_game);

input.mouse.disabled_to_game->store (config.input.mouse.disabled_to_game);
input.mouse.disabled_to_game->store (config.input.mouse.org_disabled_to_game);

input.cursor.manage->store (config.input.cursor.manage);
input.cursor.keys_activate->store (config.input.cursor.keys_activate);
Expand Down
14 changes: 12 additions & 2 deletions src/control_panel/cfg_input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2699,11 +2699,21 @@ extern float SK_ImGui_PulseNav_Strength;
ImGui::TreePush ("");
ImGui::BeginGroup ( );
ImGui::BeginGroup ( );
ImGui::Combo ("Mouse Input", &config.input.mouse.disabled_to_game,
bool mouse_changed =
ImGui::Combo ("Mouse Input", &config.input.mouse.org_disabled_to_game,
"Enabled\0Disabled (Always)\0Disabled (in Background)\0\0");
ImGui::Combo ("Keyboard Input", &config.input.keyboard.disabled_to_game,
bool keyboard_changed =
ImGui::Combo ("Keyboard Input", &config.input.keyboard.org_disabled_to_game,
"Enabled\0Disabled (Always)\0Disabled (in Background)\0\0");

if (mouse_changed) config.input.mouse. disabled_to_game =
config.input.mouse. org_disabled_to_game;
if (keyboard_changed)config.input.keyboard. disabled_to_game =
config.input.keyboard.org_disabled_to_game;

if (mouse_changed || keyboard_changed)
config.utility.save_async ();

if (ImGui::IsItemHovered () && config.input.keyboard.disabled_to_game == SK_InputEnablement::DisabledInBackground)
ImGui::SetTooltip ("Most games block keyboard input in the background to begin with...");

Expand Down
9 changes: 9 additions & 0 deletions src/input/keyboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,18 @@ SK_ImGui_WantKeyboardCapture (bool update)
// Allow keyboard input while ReShade overlay is active
if (SK_ReShadeAddOn_IsOverlayActive ())
{
config.input.mouse .disabled_to_game = 2;
config.input.keyboard.disabled_to_game = 2;
capture.store (false);
return false;
}
else
{
config.input.mouse. disabled_to_game =
config.input.mouse. org_disabled_to_game;
config.input.keyboard. disabled_to_game =
config.input.keyboard.org_disabled_to_game;
}

// Allow keyboard input while Steam /EOS overlays are active
if (SK::SteamAPI::GetOverlayState (true) ||
Expand Down

0 comments on commit 1cc5c8e

Please sign in to comment.