| 86 | } |
| 87 | |
| 88 | raw_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 | |
| 109 | void raw_mouse::update_window_handle() |
| 110 | { |