Skip to content
Draft
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
9d0ca84
added SDL
AL2009man Mar 10, 2026
67ef09c
replace DirectInput Mouse with SDL Mouse
AL2009man Mar 14, 2026
7fe9de1
attempt to replace Win32 DPI Lock
AL2009man Mar 14, 2026
5cfb5d1
replace Win32 Cursor with SDL Cursor event
AL2009man Mar 14, 2026
4e34806
applied copilot suggestions
AL2009man Mar 14, 2026
4d472c9
restoring D3D Bitt-map scaling
AL2009man Mar 15, 2026
712dff6
restores stock/sdl mouse button
AL2009man Mar 15, 2026
a4c1f5a
upgrade SDL package with CMake FetchContent
AL2009man Mar 15, 2026
2a93e57
adds SDL Keyboard
AL2009man Mar 16, 2026
37b1795
backport timer fixes
AL2009man Mar 16, 2026
587c3c8
move minor SDL Mouse config ordering
AL2009man Mar 16, 2026
a374ba2
fixed SDL cursor centering fallback
AL2009man Mar 16, 2026
7db1050
You can now swap between Input Modes
AL2009man Mar 17, 2026
f3d03b0
Additional Mouse buttons, refactor SDL input handling, fixed input mo…
AL2009man Mar 17, 2026
11dde05
Reset accumulated SDL mouse motion when unfocused
AL2009man Mar 17, 2026
ce4d3c3
added Alt key binding to both Legacy and SDL Keyboard
AL2009man Mar 17, 2026
063a5dc
Merge branch 'master' into SDL-Mouse
AL2009man Mar 18, 2026
c9fed47
centralize SDL Mouse accumulators
AL2009man Mar 19, 2026
be4ecea
replace leftover code during the InputMode expansion
AL2009man Mar 19, 2026
302453a
fix merge conflict after the multiplayer bot update
AL2009man Mar 20, 2026
00894db
Merge branch 'master' into SDL-Mouse
AL2009man Mar 20, 2026
a43cf10
fixed build error after multiplayer bot support
Mar 20, 2026
703dc94
fix camera spinning when in SDL Input mode
Mar 21, 2026
b5dbf84
Merge branch 'master' into SDL-Mouse
AL2009man Mar 24, 2026
68ee6fc
fix regression with Mouse Scale button disappearing in the Controls tab
AL2009man Mar 24, 2026
12a9cbf
Merge branch 'master' into SDL-Mouse
AL2009man Mar 26, 2026
9274bff
restored sdl window/mouse state during the merge
AL2009man Mar 26, 2026
d9aca94
adds ALT tab camera freeze fix
AL2009man Mar 26, 2026
a1d770b
fixed multiple regressions after mouse-scale migration
AL2009man Mar 26, 2026
2cf5a27
change SDL3 `CMakeLists.txt` to include hash
AL2009man Mar 27, 2026
3ebaa5e
update to SDL 3.4.4
AL2009man Apr 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions game_patch/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ set(SRCS
graphics/d3d11/gr_d3d11_hooks.cpp
graphics/d3d11/gr_d3d11_hooks.h
input/input.h
input/input.cpp
input/mouse.cpp
input/mouse.h
input/key.cpp
hud/hud_colors.cpp
hud/hud_scale.cpp
Expand Down Expand Up @@ -327,4 +329,13 @@ target_link_libraries(AlpineFaction
ws2_32
freetype
stb_vorbis
SDL3::SDL3-static
)

if(WIN32)
target_link_libraries(AlpineFaction
setupapi
imm32
cfgmgr32
)
endif()
13 changes: 13 additions & 0 deletions game_patch/input/input.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Central SDL event pump for all input subsystems.
#include <SDL3/SDL.h>
#include "input.h"
#include "../misc/alpine_settings.h"

void sdl_input_poll()
{
if (SDL_IsMainThread())
SDL_PumpEvents();
if (g_alpine_game_config.input_mode == 2)
keyboard_sdl_poll();
mouse_sdl_poll();
}
31 changes: 30 additions & 1 deletion game_patch/input/input.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,37 @@
#pragma once

#include "../rf/player/control_config.h"
#include "mouse.h"

// Sentinel scan code injected into Input Rebind UI, allowing additional input bindings.
static constexpr int CTRL_REBIND_SENTINEL = 0x58; // KEY_F12

// Extra keyboard scan codes not in RF's original DInput table.
// Placed after CTRL_EXTRA_MOUSE_SCAN (0x75–0x79), before RF extended keys (0x9C+).
static constexpr int CTRL_EXTRA_KEY_SCAN_BASE = 0x7A;
static constexpr int CTRL_EXTRA_KEY_SCAN_COUNT = 14;

enum ExtraKeyScanOffset : int {
EXTRA_KEY_KP_DIVIDE = 0, // SDL_SCANCODE_KP_DIVIDE
EXTRA_KEY_NONUSBACKSLASH, // SDL_SCANCODE_NONUSBACKSLASH (ISO key between LShift and Z)
EXTRA_KEY_F13, // SDL_SCANCODE_F13 … F24
EXTRA_KEY_F14,
EXTRA_KEY_F15,
EXTRA_KEY_F16,
EXTRA_KEY_F17,
EXTRA_KEY_F18,
EXTRA_KEY_F19,
EXTRA_KEY_F20,
EXTRA_KEY_F21,
EXTRA_KEY_F22,
EXTRA_KEY_F23,
EXTRA_KEY_F24,
};

rf::ControlConfigAction get_af_control(rf::AlpineControlConfigAction alpine_control);
rf::String get_action_bind_name(int action);
void mouse_apply_patch();
void keyboard_sdl_poll();
int key_take_pending_extra_rebind();
void sdl_input_poll();
void key_apply_patch();
void set_input_mode(int mode);
400 changes: 337 additions & 63 deletions game_patch/input/key.cpp

Large diffs are not rendered by default.

Loading
Loading