aboutsummaryrefslogtreecommitdiff
path: root/src/SearchBar.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2022-09-12 02:23:30 +0200
committerdec05eba <dec05eba@protonmail.com>2022-09-12 02:23:30 +0200
commita6f23372c0e9c26bd6e23c3ebec047e4211dcb93 (patch)
treef213e580b49578a6ed8ce1e5599594767fefae99 /src/SearchBar.cpp
parentc944b7b874ce2296b0c67cd9e7c670304c514e1f (diff)
Fix key/button state when window loses focus (check state on call to is_**_pressed)
Diffstat (limited to 'src/SearchBar.cpp')
-rw-r--r--src/SearchBar.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/SearchBar.cpp b/src/SearchBar.cpp
index 52e75e6..2371762 100644
--- a/src/SearchBar.cpp
+++ b/src/SearchBar.cpp
@@ -131,7 +131,8 @@ namespace QuickMedia {
return;
}
- if((window.is_key_pressed(mgl::Keyboard::LControl) || window.is_key_pressed(mgl::Keyboard::RControl)) && (event.type != mgl::Event::TextEntered || event.text.codepoint != 13)) // Enter
+ const bool pressing_ctrl = (event.type == mgl::Event::KeyPressed && event.key.control);
+ if(pressing_ctrl && (event.type != mgl::Event::TextEntered || event.text.codepoint != 13)) // Enter
return;
if(event.type == mgl::Event::TextEntered && event.text.codepoint != 8 && event.text.codepoint != 127) { // 8 = backspace, 127 = del