QTfrontend/game.cpp
changeset 10850 c76ea22ea249
parent 10571 c90a1814a91b
child 10851 f25dad9c3136
--- a/QTfrontend/game.cpp	Fri Mar 06 21:24:21 2015 +0100
+++ b/QTfrontend/game.cpp	Sun Mar 08 01:04:41 2015 +0100
@@ -16,6 +16,9 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+#include <QApplication>
+#include <QClipboard>
+
 #include <QString>
 #include <QCheckBox>
 #include <QByteArray>
@@ -210,6 +213,18 @@
             SendIPC("!");
             break;
         }
+        case 'Y':
+        {
+            // copy string to clipboard
+            QApplication::clipboard()->setText(QString::fromUtf8(msg.mid(2)));
+            break;
+        }
+        case 'P':
+        {
+            // paste clipboard to game
+            SendIPC(QString("P").toAscii() + QApplication::clipboard()->text().toUtf8().left(254).replace('\n', ' '));
+            break;
+        }
         case 'C':
         {
             switch (gameType)