By popular demand: a plugin to support copy/paste, integrating with the Windows clipboard!
This plugin allows you to copy text from other applications and paste it into an AGS game, or vice versa.
The plugin provides two methods:
bool Clipboard.CopyText(String copyString);
String Clipboard.PasteText();
Calling
Clipboard.CopyText(copyString) will put
copyString on the Windows clipboard (returning
true if successful), accessible to other applications. Calling
Clipboard.PasteText() returns the current text content of the Windows clipboard as a String (or
null if none) that you can use in-game. Pretty simple.
As with all AGS engine plugins, you have to place the .dll file in the AGS engine folder, then activate it in the IDE from the project tree before you can use the methods. It should be unnecessary to state, but for the record: the game must be designed and created to use the plugin, you can't just drop it into the folder of a finished game and expect it to do anything.
This is my first AGS plugin, and my first C++ project in many years. It works on my machine, but I'm not 100% sure it will work on
every Windows machine – in particular on older Windows versions.
If you could try the demo and let me know if you experience any problems, I'd appreciate it.The code is available on
Github. (In the demo game, the example of how to use it is in
TextField.HandleKeyPress(), starting on line 538.)
Download Clipboard pluginDownload Clipboard demoChange log:v0.4-Initial release (untested except for on my own machine)