diff options
Diffstat (limited to 'src/SearchBar.cpp')
-rw-r--r-- | src/SearchBar.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/SearchBar.cpp b/src/SearchBar.cpp index 676618a..7c20568 100644 --- a/src/SearchBar.cpp +++ b/src/SearchBar.cpp @@ -99,6 +99,12 @@ namespace QuickMedia { append_text(std::string(clipboard.begin(), clipboard.end())); } + if(event.type == sf::Event::KeyPressed && event.key.code == sf::Keyboard::D && event.key.control) { + clear(); + updated_search = true; + updated_autocomplete = true; + } + if(event.type == sf::Event::TextEntered && event.text.unicode != 8 && event.text.unicode != 127) // 8 = backspace, 127 = del onTextEntered(event.text.unicode); else if(event.type == sf::Event::KeyPressed && event.key.code == sf::Keyboard::Backspace) @@ -124,6 +130,7 @@ namespace QuickMedia { if(backspace_pressed) timeout = 750; if(updated_search && elapsed_time >= timeout) { + fprintf(stderr, "update search!\n"); updated_search = false; auto u8 = text.getString().toUtf8(); std::string *u8_str = (std::string*)&u8; |