aboutsummaryrefslogtreecommitdiff
path: root/src/gui/Entry.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-10-27 13:09:06 +0100
committerdec05eba <dec05eba@protonmail.com>2024-10-27 13:09:06 +0100
commit59dfd87c21026ef4dc713c3e0648cfa89d534557 (patch)
tree6f2f5242eb9efdcb18f0150c59cb43bd1a348773 /src/gui/Entry.cpp
parent28c437e90a3ad4660f44da8b8bf07008032d2bba (diff)
Add hotkeys for replay and streaming, finish everything
Diffstat (limited to 'src/gui/Entry.cpp')
-rw-r--r--src/gui/Entry.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gui/Entry.cpp b/src/gui/Entry.cpp
index 0bea60e..1cb8d16 100644
--- a/src/gui/Entry.cpp
+++ b/src/gui/Entry.cpp
@@ -21,7 +21,7 @@ namespace gsr {
set_text(text);
}
- bool Entry::on_event(mgl::Event &event, mgl::Window&, mgl::vec2f offset) {
+ bool Entry::on_event(mgl::Event &event, mgl::Window &window, mgl::vec2f offset) {
if(!visible)
return true;
@@ -33,6 +33,11 @@ namespace gsr {
const size_t prev_index = mgl::utf8_get_start_of_codepoint((const unsigned char*)str.c_str(), str.size(), str.size());
str.erase(prev_index, std::string::npos);
set_text(std::move(str));
+ } else if(event.key.code == mgl::Keyboard::V && event.key.control) {
+ std::string clipboard_text = window.get_clipboard_string();
+ std::string str = text.get_string();
+ str += clipboard_text;
+ set_text(std::move(str));
}
} else if(event.type == mgl::Event::TextEntered && selected && event.text.codepoint >= 32) {
std::string str = text.get_string();