Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 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
914b3c5
Merge branch 'master' into SDL-Mouse
AL2009man Apr 18, 2026
c25faad
Merge conflict cleanup, fix regression, partially revert bitmap scaling
AL2009man Apr 18, 2026
a4df9c3
experimental On-Screen Keyboard support
AL2009man Apr 18, 2026
62661d4
sdl event flush moved to os.cpp
AL2009man Apr 21, 2026
577fd65
switch SDL Polling method
AL2009man Apr 28, 2026
cbc1302
rename game config name
AL2009man Apr 28, 2026
c7e6c59
Merge branch 'master' into SDL-Mouse
AL2009man Apr 28, 2026
d5b9425
Update to SDL 3.4.6, update notes
AL2009man May 1, 2026
17e1b42
update to SDL 3.4.8
AL2009man May 2, 2026
b8cd95a
Add mouse event flushing to prevent WM_MOUSEMOVE spam in SDL input po…
AL2009man May 6, 2026
0d78ecc
attempt to fix sdl video window init
AL2009man May 8, 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
12 changes: 11 additions & 1 deletion game_patch/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,9 @@ set(SRCS
graphics/d3d11/gr_d3d11_gamma.h
graphics/d3d11/gr_d3d11_gamma.cpp
input/input.h
input/mouse.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 @@ -334,4 +335,13 @@ target_link_libraries(AlpineFaction
freetype
stb_vorbis
stb_image
SDL3::SDL3
)

if(WIN32)
target_link_libraries(AlpineFaction
setupapi
imm32
cfgmgr32
)
endif()
28 changes: 28 additions & 0 deletions game_patch/input/input.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#include <SDL3/SDL.h>
#include "input.h"
#include "mouse.h"
#include "../os/os.h"

void sdl_input_poll()
{
if (!g_sdl_window) return;

SDL_Event ev;
while (SDL_PollEvent(&ev)) {
switch (ev.type) {
case SDL_EVENT_TEXT_INPUT:
case SDL_EVENT_KEY_DOWN:
case SDL_EVENT_KEY_UP:
process_keyboard_event(ev);
break;
case SDL_EVENT_MOUSE_MOTION:
case SDL_EVENT_MOUSE_BUTTON_DOWN:
case SDL_EVENT_MOUSE_BUTTON_UP:
case SDL_EVENT_MOUSE_WHEEL:
process_mouse_event(ev);
break;
default:
break;
}
}
}
34 changes: 33 additions & 1 deletion game_patch/input/input.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,40 @@
#pragma once

#include <string>
#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;
Comment on lines +7 to +13

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 process_keyboard_event(const SDL_Event& evt);
void sdl_input_poll();
int key_take_pending_extra_rebind();
std::string keyboard_take_pending_text();
void key_apply_patch();
void set_kbm_input_mode(int mode);
void ui_refresh_kbm_input_mode_label();
Loading
Loading