mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-02 06:40:42 -07:00
overlay: fix mouse events queued up while overlay is hidden (#683)
## Link to GitHub Issue or related Pull Request, if one exists continuation of #677 ## Description of change When overlay was hidden, when mouse buttons were clicked, they were queued up and replayed when overlay became visible again. This is due to improper usage of `GetAsyncKeyState`, per documentation. ## Testing
This commit is contained in:
@@ -319,14 +319,14 @@ bool acquire_shutdown_privs();
|
||||
|
||||
void generate_ea_card(char card[17]);
|
||||
|
||||
static inline int get_async_primary_mouse() {
|
||||
static inline bool get_async_primary_mouse() {
|
||||
int vk = GetSystemMetrics(SM_SWAPBUTTON) ? VK_RBUTTON : VK_LBUTTON;
|
||||
return GetAsyncKeyState(vk);
|
||||
return (GetAsyncKeyState(vk) & 0x8000) != 0;
|
||||
}
|
||||
|
||||
static inline int get_async_secondary_mouse() {
|
||||
static inline bool get_async_secondary_mouse() {
|
||||
int vk = GetSystemMetrics(SM_SWAPBUTTON) ? VK_LBUTTON : VK_RBUTTON;
|
||||
return GetAsyncKeyState(vk);
|
||||
return (GetAsyncKeyState(vk) & 0x8000) != 0;
|
||||
}
|
||||
|
||||
static inline bool parse_width_height(const std::string wh, std::pair<uint32_t, uint32_t> &result) {
|
||||
|
||||
Reference in New Issue
Block a user