aboutsummaryrefslogtreecommitdiff
path: root/src/SearchBar.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-03-09 02:04:19 +0100
committerdec05eba <dec05eba@protonmail.com>2021-03-09 02:04:19 +0100
commit1fe31ba2e244d9ae26d1f8d00f411713d2eaacf7 (patch)
treeb8fbb0d8ed2c81dcbee1e4e94e33f0839333ddf7 /src/SearchBar.cpp
parentf8617f2043ea4ec536c4622df63a77b25268aeb0 (diff)
Fix clipboard unicode
Diffstat (limited to 'src/SearchBar.cpp')
-rw-r--r--src/SearchBar.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/SearchBar.cpp b/src/SearchBar.cpp
index 5c5b860..9b5e882 100644
--- a/src/SearchBar.cpp
+++ b/src/SearchBar.cpp
@@ -92,8 +92,10 @@ namespace QuickMedia {
backspace_pressed = true;
else if(event.type == sf::Event::KeyReleased && event.key.code == sf::Keyboard::Backspace)
backspace_pressed = false;
- if(event.type == sf::Event::KeyPressed && event.key.code == sf::Keyboard::V && event.key.control)
- append_text(sf::Clipboard::getString());
+ if(event.type == sf::Event::KeyPressed && event.key.code == sf::Keyboard::V && event.key.control) {
+ auto clipboard = sf::Clipboard::getString().toUtf8();
+ append_text(std::string(clipboard.begin(), clipboard.end()));
+ }
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)