From daefd0ab367605eabe1a293dd7f6a50964bb3801 Mon Sep 17 00:00:00 2001 From: Kahrl Date: Fri, 19 Sep 2014 22:26:38 +0200 Subject: Add paste command (Ctrl-V) in GUIChatConsole --- src/guiChatConsole.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/guiChatConsole.cpp') diff --git a/src/guiChatConsole.cpp b/src/guiChatConsole.cpp index 62ce0d1e1..918f9528b 100644 --- a/src/guiChatConsole.cpp +++ b/src/guiChatConsole.cpp @@ -507,6 +507,19 @@ bool GUIChatConsole::OnEvent(const SEvent& event) scope); return true; } + else if(event.KeyInput.Key == KEY_KEY_V && event.KeyInput.Control) + { + // Ctrl-V pressed + // paste text from clipboard + IOSOperator *os_operator = Environment->getOSOperator(); + const c8 *text = os_operator->getTextFromClipboard(); + if (text) + { + std::wstring wtext = narrow_to_wide(text); + m_chat_backend->getPrompt().input(wtext); + } + return true; + } else if(event.KeyInput.Key == KEY_KEY_U && event.KeyInput.Control) { // Ctrl-U pressed -- cgit v1.2.3