Skip to content

Commit

Permalink
Merge branch 'SpecialKO:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
deorth-kku authored Nov 9, 2024
2 parents abd842b + d446335 commit 9e715db
Show file tree
Hide file tree
Showing 30 changed files with 760 additions and 460 deletions.
69 changes: 68 additions & 1 deletion CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,71 @@
24.11.3
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
to the game.

24.11.5
=======
+ Optimized keyboard handling in proxy Windows (Low-Level) Hook procedures
+ Ensure that all keyboard input a game sees through a keyboard hook while
the window is not actually active are key releases, so that upon upon
alt-tabbing back, they do not do that stupid thing they usually do
where they think a key is permanently stuck down.

24.11.4.5
=========
+ Removed the last remaining remnants of SK's original cursor anti-warp system.

24.11.4.4
=========
+ Disable periodic LatentSync resync when G-Sync is active
+ Remove warning about using LatentSync on VRR displays

24.11.4.3
=========
+ Xbox/PlayStation + Right/Left trigger will Minimize/Restore the game.

24.11.4.2
=========
+ The Xbox/PlayStation button on gamepads can now be used to activate a
chord input without that input counting for screensaver deactivation.
* In other words, you can use chorded feature like volume control while
a screensaver is active.
+ Make UI navigation moving the mouse cursor a persistent (global) config
option, and turn it off by default.

24.11.4.1
=========
+ Correctly restore hardware cursor image when closing the control panel and
cursor centering is turned off.

24.11.4
=======
+ Ensure confirmation dialogs cannot be dismissed using the overlay toggle
keyboard / gamepad bindings, and gamepad is always captured while they
are waiting for a user response.
+ Make cursor centering on SK's control panel into a configurable option.
* Refer to: Input Management > Mouse Cursor; this is a global preference.

24.11.3.3
=========
+ Hide mouse cursor when the game is using SetCursorPos (...) to implement
mouselook and cursor management is enabled.
+ Ensure that upon closing the keybind editor dialog, the keybind configured
does not immediately trigger.

24.11.3.2
=========
+ Change keyboard/mouse/gamepad blocking state so that it is evaluated
once per-frame frame and all other tests use the value set at the
beginning of a game's frame.

24.11.3.1
=========
+ Handle UnhookWindowsHookEx (...) correctly, by setting the HHOOK handle
during SetWindowsHookEx{A|W} (...).

24.11.3
=======
+ Disable mouse while SK's control panel is open in Dragon Age The Veilguard.

Expand Down
5 changes: 3 additions & 2 deletions depends/include/ReShade/reshade.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
* Copyright (C) 2021 Patrick Mours
* SPDX-License-Identifier: BSD-3-Clause OR MIT
*/
Expand Down Expand Up @@ -242,13 +242,14 @@ namespace reshade
// Check that the ReShade module supports the used API
if (func == nullptr || !func(addon_module, RESHADE_API_VERSION))
return false;

#if 0
#if defined(IMGUI_VERSION_NUM)
const auto imgui_func = reinterpret_cast<const imgui_function_table *(*)(uint32_t)>(
GetProcAddress(reshade_module, "ReShadeGetImGuiFunctionTable"));
// Check that the ReShade module was built with Dear ImGui support and supports the used version
if (imgui_func == nullptr || !(imgui_function_table_instance() = imgui_func(IMGUI_VERSION_NUM)))
return false;
#endif
#endif

return true;
Expand Down
4 changes: 3 additions & 1 deletion depends/include/ReShade/reshade_overlay.hpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/*
/*
* Copyright (C) 2021 Patrick Mours
* Copyright (C) 2014-2023 Omar Cornut
* SPDX-License-Identifier: BSD-3-Clause OR MIT
*/

#if 0
#if defined(IMGUI_VERSION_NUM)

#if IMGUI_VERSION_NUM != 18971
Expand Down Expand Up @@ -868,3 +869,4 @@ inline void ImFont::RenderText(ImDrawList* draw_list, float size, const ImVec2&
#endif

#endif
#endif
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 3
#define SK_REV_N 0
#define SK_REV 0
#define SK_DATE 5
#define SK_REV_N 1
#define SK_REV 1

#ifndef _A2
#define _A2(a) #a
Expand Down
16 changes: 5 additions & 11 deletions include/SpecialK/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ namespace sk
class ParameterStringW;
};

void SK_ImGui_BeginKeybindEditorFrame (void);
ULONG64 SK_ImGui_GetLastKeybindEditorFrame (void);

// Adds a parameter to store and retrieve the keybind in an INI / XML file
struct SK_ConfigSerializedKeybind : public SK_Keybind
{
Expand Down Expand Up @@ -1049,7 +1052,8 @@ struct sk_config_t
bool capture_keyboard = false; // ^^^ Disabled by default because it interferes with cursor auto-hide
bool capture_gamepad = false;
bool use_hw_cursor = true;
bool use_raw_input = true;
bool center_cursor = false;
bool nav_moves_mouse = false;
int game_set_hw_cursor = 0; // Not stored in INI, the number of times
} ui;

Expand Down Expand Up @@ -1148,16 +1152,6 @@ struct sk_config_t
} keyboard; // ignore "disabled_to_game"

struct mouse_s {
//
// Uses APIs such as DirectInput or RawInput that only send relative motion events
// to derive the virtual position of the cursor, since the game hijacks the
// physical position.
//
// >> Ideally we want absolute cursor position every frame for the UI, but
// that's not always possible. <<
//
float antiwarp_deadzone = 2.5F;

// Translate WM_MOUSEWHEEL messages into actual events that will trigger
// other mouse APIs such as DirectInput and RawInput.
//
Expand Down
4 changes: 2 additions & 2 deletions include/SpecialK/control_panel/input.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/**
* This file is part of Special K.
*
* Special K is free software : you can redistribute it
Expand Down Expand Up @@ -33,6 +33,6 @@ namespace SK
};
};

extern void SK_ImGui_CursorBoundaryConfig (void);
extern void SK_ImGui_CursorBoundaryConfig (bool);

#endif /* __SK__CPL_INPUT_H__ */
4 changes: 2 additions & 2 deletions include/SpecialK/control_panel/window.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/**
* This file is part of Special K.
*
* Special K is free software : you can redistribute it
Expand Down Expand Up @@ -33,6 +33,6 @@ namespace SK
};
};

extern void SK_ImGui_CursorBoundaryConfig (void);
extern void SK_ImGui_CursorBoundaryConfig (bool);

#endif /* __SK__CPL_WINDOW_H__ */
11 changes: 7 additions & 4 deletions include/SpecialK/input/input.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ extern int64_t SK_PerfFreq;

#define SK_LOG_INPUT_CALL { static int calls = 0; { SK_LOG0 ( (L"[!] > Call #%lu: %hs", calls++, __FUNCTION__), L"Input Mgr." ); } }

bool SK_ImGui_WantGamepadCapture (void);
bool SK_ImGui_WantGamepadCapture (bool update = false);
bool SK_ImGui_WantHWCursor (void);
bool SK_ImGui_WantMouseCapture (void);
bool SK_ImGui_WantMouseCapture (bool update = false);
bool SK_ImGui_WantMouseCaptureEx (DWORD dwReasonMask = 0xFFFF);
bool SK_ImGui_WantKeyboardCapture (void);
bool SK_ImGui_WantKeyboardCapture (bool update = false);
bool SK_ImGui_WantTextCapture (void);
void SK_ImGui_UpdateMouseTracker (void);

Expand Down Expand Up @@ -119,6 +119,7 @@ struct sk_imgui_cursor_s
bool visible = false;
bool idle = true; // Hasn't moved
DWORD last_move = MAXDWORD;
DWORD last_toggle = 0;
DWORD refs_added = 0;
DWORD64 times_set = 0; // Times the game has set a non-zero cursor

Expand Down Expand Up @@ -1225,11 +1226,13 @@ BOOL WINAPI SK_SendMsgShowCursor ( BOOL bShow );
HCURSOR WINAPI SK_SendMsgSetCursor (HCURSOR hCursor);

bool SK_ImGui_ExemptOverlaysFromKeyboardCapture (void);
bool SK_ImGui_IsMouseRelevant (void);
bool SK_ImGui_IsMouseRelevant (bool update = false);
void ImGui_ToggleCursor (void);
HCURSOR ImGui_DesiredCursor (void);
bool SK_InputUtil_IsHWCursorVisible (void);
bool SK_Window_IsCursorActive (void);
bool SK_ImGui_CursorWarpingCooledDown (void);
void SK_ImGui_UpdateLastCursorWarpTime (void);

enum SK_InputEnablement {
Enabled = 0,
Expand Down
4 changes: 2 additions & 2 deletions include/SpecialK/window.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ enum WindowTopPreference


void SK_HookWinAPI (void);
void SK_InstallWindowHook (HWND hWnd);
bool SK_InstallWindowHook (HWND hWnd);
void SK_InitWindow (HWND hWnd, bool fullscreen_exclusive = false);
void SK_AdjustWindow (void);
void SK_AdjustBorder (void);
Expand Down Expand Up @@ -550,7 +550,7 @@ class SK_TLS;

bool
__stdcall
SK_IsGameWindowActive (void);
SK_IsGameWindowActive (bool activate_if_in_limbo = false);

bool
__stdcall
Expand Down
Loading

0 comments on commit 9e715db

Please sign in to comment.