mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-23 18:45:36 +00:00
Updated SDL_INVALID_ID=UINT32_MAX macro to SDL_UNMAPPED=UINT32_MAX-1
This commit is contained in:
parent
e2ff8fa46e
commit
60ecdb0c1e
@ -412,7 +412,7 @@ void ParseInputConfig(const std::string game_id = "") {
|
|||||||
u32 GetMouseWheelEvent(const SDL_Event& event) {
|
u32 GetMouseWheelEvent(const SDL_Event& event) {
|
||||||
if (event.type != SDL_EVENT_MOUSE_WHEEL && event.type != SDL_EVENT_MOUSE_WHEEL_OFF) {
|
if (event.type != SDL_EVENT_MOUSE_WHEEL && event.type != SDL_EVENT_MOUSE_WHEEL_OFF) {
|
||||||
LOG_WARNING(Input, "Something went wrong with wheel input parsing!");
|
LOG_WARNING(Input, "Something went wrong with wheel input parsing!");
|
||||||
return SDL_INVALID_ID;
|
return SDL_UNMAPPED;
|
||||||
}
|
}
|
||||||
if (event.wheel.y > 0) {
|
if (event.wheel.y > 0) {
|
||||||
return SDL_MOUSE_WHEEL_UP;
|
return SDL_MOUSE_WHEEL_UP;
|
||||||
@ -423,7 +423,7 @@ u32 GetMouseWheelEvent(const SDL_Event& event) {
|
|||||||
} else if (event.wheel.x < 0) {
|
} else if (event.wheel.x < 0) {
|
||||||
return SDL_MOUSE_WHEEL_LEFT;
|
return SDL_MOUSE_WHEEL_LEFT;
|
||||||
}
|
}
|
||||||
return SDL_INVALID_ID;
|
return SDL_UNMAPPED;
|
||||||
}
|
}
|
||||||
|
|
||||||
InputEvent InputBinding::GetInputEventFromSDLEvent(const SDL_Event& e) {
|
InputEvent InputBinding::GetInputEventFromSDLEvent(const SDL_Event& e) {
|
||||||
@ -574,7 +574,7 @@ void ControllerOutput::FinalizeUpdate() {
|
|||||||
bool UpdatePressedKeys(InputEvent event) {
|
bool UpdatePressedKeys(InputEvent event) {
|
||||||
// Skip invalid inputs
|
// Skip invalid inputs
|
||||||
InputID input = event.input;
|
InputID input = event.input;
|
||||||
if (input.sdl_id == SDL_INVALID_ID) {
|
if (input.sdl_id == SDL_UNMAPPED) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (input.type == InputType::Axis) {
|
if (input.type == InputType::Axis) {
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
#define KEY_TOGGLE 0x00200000
|
#define KEY_TOGGLE 0x00200000
|
||||||
|
|
||||||
#define SDL_INVALID_ID UINT32_MAX
|
#define SDL_UNMAPPED UINT32_MAX - 1
|
||||||
|
|
||||||
namespace Input {
|
namespace Input {
|
||||||
using Input::Axis;
|
using Input::Axis;
|
||||||
@ -51,7 +51,7 @@ class InputID {
|
|||||||
public:
|
public:
|
||||||
InputType type;
|
InputType type;
|
||||||
u32 sdl_id;
|
u32 sdl_id;
|
||||||
InputID(InputType d = InputType::Count, u32 i = SDL_INVALID_ID) : type(d), sdl_id(i) {}
|
InputID(InputType d = InputType::Count, u32 i = SDL_UNMAPPED) : type(d), sdl_id(i) {}
|
||||||
bool operator==(const InputID& o) const {
|
bool operator==(const InputID& o) const {
|
||||||
return type == o.type && sdl_id == o.sdl_id;
|
return type == o.type && sdl_id == o.sdl_id;
|
||||||
}
|
}
|
||||||
@ -259,6 +259,7 @@ const std::map<std::string, u32> string_to_keyboard_key_map = {
|
|||||||
{"mousewheeldown", SDL_MOUSE_WHEEL_DOWN},
|
{"mousewheeldown", SDL_MOUSE_WHEEL_DOWN},
|
||||||
{"mousewheelleft", SDL_MOUSE_WHEEL_LEFT},
|
{"mousewheelleft", SDL_MOUSE_WHEEL_LEFT},
|
||||||
{"mousewheelright", SDL_MOUSE_WHEEL_RIGHT},
|
{"mousewheelright", SDL_MOUSE_WHEEL_RIGHT},
|
||||||
|
{"unmapped", SDL_UNMAPPED},
|
||||||
};
|
};
|
||||||
|
|
||||||
void ParseInputConfig(const std::string game_id);
|
void ParseInputConfig(const std::string game_id);
|
||||||
|
Loading…
Reference in New Issue
Block a user