MCPcopy Create free account
hub / github.com/RPCSX/rpcsx / get_mouse_button

Method get_mouse_button

rpcs3/Input/raw_mouse_handler.cpp:88–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86}
87
88raw_mouse::mouse_button raw_mouse::get_mouse_button(const cfg::string& button)
89{
90 const std::string value = button.to_string();
91
92 if (const auto it = raw_mouse_button_map.find(value); it != raw_mouse_button_map.cend())
93 {
94 return ::at32(btn_pairs, it->second);
95 }
96
97 if (value.starts_with(raw_mouse_config::key_prefix))
98 {
99 s64 scan_code{};
100 if (try_to_int64(&scan_code, value.substr(raw_mouse_config::key_prefix.size()), s32{smin}, s32{smax}))
101 {
102 return mouse_button{0, 0, static_cast<s32>(scan_code), true};
103 }
104 }
105
106 return {};
107}
108
109void raw_mouse::update_window_handle()
110{

Callers

nothing calls this directly

Calls 6

try_to_int64Function · 0.85
substrMethod · 0.80
to_stringMethod · 0.45
findMethod · 0.45
cendMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected