diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/widgets/textfield.cpp | 10 | ||||
-rw-r--r-- | src/gui/widgets/textfield.h | 2 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/gui/widgets/textfield.cpp b/src/gui/widgets/textfield.cpp index 2729e5407..d9f5bed9a 100644 --- a/src/gui/widgets/textfield.cpp +++ b/src/gui/widgets/textfield.cpp @@ -309,6 +309,10 @@ void TextField::keyPressed(gcn::KeyEvent &keyEvent) } break; + case 3: + handleCopy(); + break; + case 22: // Control code 22, SYNCHRONOUS IDLE, sent on Ctrl+v // hack to prevent paste key sticking if (mLastEventPaste && mLastEventPaste > cur_time) @@ -348,3 +352,9 @@ void TextField::handlePaste() setCaretPosition(static_cast<unsigned>(caretPos)); } } + +void TextField::handleCopy() +{ + std::string text = getText(); + sendBuffer(text); +} diff --git a/src/gui/widgets/textfield.h b/src/gui/widgets/textfield.h index 79197bb7a..79790d83a 100644 --- a/src/gui/widgets/textfield.h +++ b/src/gui/widgets/textfield.h @@ -99,6 +99,8 @@ class TextField : public gcn::TextField private: void handlePaste(); + void handleCopy(); + static int instances; static float mAlpha; static ImageRect skin; |