From 59dfd87c21026ef4dc713c3e0648cfa89d534557 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 27 Oct 2024 13:09:06 +0100 Subject: Add hotkeys for replay and streaming, finish everything --- src/gui/Entry.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/gui/Entry.cpp') 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(); -- cgit v1.2.3