Skip to content

Commit 6337803

Browse files
committed
feat:
- steam_input emulation with sdl3 instead of gamepad.c - implemented ActionSetLayers - added configurable deadzone under main::gamepad
1 parent a7ec484 commit 6337803

File tree

9 files changed

+4015
-2891
lines changed

9 files changed

+4015
-2891
lines changed

dll/dll/common_includes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ static inline void reset_LastError()
146146
#endif
147147

148148
// Other libs includes
149-
#include "gamepad/gamepad.h"
149+
// #include "gamepad/gamepad.h"
150150

151151
// Steamsdk includes
152152
#include "steam/steam_api.h"

dll/dll/settings.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,10 @@ class Settings {
307307
//controller
308308
struct Controller_Settings controller_settings{};
309309
std::string glyphs_directory{};
310-
310+
bool flip_nintendo_layout = false;
311+
bool combine_joycons = true;
312+
uint16 inner_deadzone = 2000;
313+
uint16 outer_deadzone = 3000;
311314

312315
// allow Steam_User_Stats::FindLeaderboard() to always succeed and create the given unknown leaderboard
313316
bool disable_leaderboards_create_unknown = false;

dll/dll/steam_controller.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@
1717

1818
#ifndef __INCLUDED_STEAM_CONTROLLER_H__
1919
#define __INCLUDED_STEAM_CONTROLLER_H__
20+
#define GAMEPAD_COUNT 4
2021

2122
#include "base.h"
22-
23+
#include "gamepad_provider/gamepad_provider.hpp"
2324

2425
struct Controller_Map {
2526
std::map<ControllerDigitalActionHandle_t, std::set<int>> active_digital{};
@@ -30,10 +31,13 @@ struct Controller_Action {
3031
ControllerHandle_t controller_handle{};
3132
struct Controller_Map active_map{};
3233
ControllerDigitalActionHandle_t active_set{};
34+
std::map<ControllerActionSetHandle_t, struct Controller_Map> active_layers{};
3335

3436
Controller_Action(ControllerHandle_t controller_handle);
3537

3638
void activate_action_set(ControllerDigitalActionHandle_t active_set, std::map<ControllerActionSetHandle_t, struct Controller_Map> &controller_maps);
39+
void activate_action_set_layer(ControllerActionSetHandle_t active_layer, std::map<ControllerActionSetHandle_t, struct Controller_Map> &controller_maps);
40+
void deactivate_action_set_layer(ControllerActionSetHandle_t active_layer);
3741
std::set<int> button_id(ControllerDigitalActionHandle_t handle);
3842
std::pair<std::set<int>, enum EInputSourceMode> analog_id(ControllerAnalogActionHandle_t handle);
3943
};
@@ -101,14 +105,16 @@ public ISteamInput
101105
std::map<EInputActionOrigin, std::string> steaminput_glyphs{};
102106
std::map<EControllerActionOrigin, std::string> steamcontroller_glyphs{};
103107

108+
std::thread sdl_thread{};
104109
std::thread background_rumble_thread{};
105110
Rumble_Thread_Data *rumble_thread_data{};
106111

107112
bool disabled{};
108113
bool initialized{};
109114
bool explicitly_call_run_frame{};
110115

111-
void set_handles(std::map<std::string, std::map<std::string, std::pair<std::set<std::string>, std::string>>> action_sets);
116+
void set_handles(std::map<std::string, std::map<std::string, std::pair<std::set<std::string>, std::string>>> action_sets,
117+
std::map<std::string, std::map<std::string, std::pair<std::set<std::string>, std::string>>> action_set_layers);
112118

113119
void RunCallbacks();
114120

dll/settings_parser.cpp

Lines changed: 1871 additions & 1855 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)