I would like to enable a user to right-click copy something from anywhere on their desktop and then go to my webapp where I can extract the contents of the desktop clipboard without the user having to go through the right-click or cntl-v process. Is there somewhere in Xojo-web that allow me to grab the clipboard content like what exists in the desktop version?
We don’t have a Clipboard class for the web, although there is a feature request for it.
Thanks for the quick response. So, my users can already CNTL-C on the desktop and then CNTL-V in my web app. What is the key benefit of the web-clipboard feature then?
Being able to manipulate the data as it’s coming in, I suppose. We could (for instance) just send the clipboard content directly to the server, where you’d parse it and return it in some other way to the user without them seeing their pasted data. There’s also Cut and Copy operations, so you might be able to do something with those as well.
If you don’t want the end user to have to click a button or do anything other then cntrl-V just attach your processing to the TextChanged event for the field they paste into.
Any trick to set the text property?
You want to read WebControlSDK.pdf in the WebSDK folder, within the Extra folder, next to the Xojo executable.
It will show you how to send back data to the app, in order to modify Text.
Is there any way to “press” a set of keys to create the effect of entering text into a Clipboard?
I am displaying text on a ListBox and do not want to run into the problem of creating files with peoples’ data on my server for users to download, so am going to have to display the text into a text field and actually have users hit Ctrl-A and Ctrl-C… … or display the data in an HTML viewer. Blech.
[quote=481385:@Amy Barnes]Is there any way to “press” a set of keys to create the effect of entering text into a Clipboard?
I am displaying text on a ListBox and do not want to run into the problem of creating files with peoples’ data on my server for users to download, so am going to have to display the text into a text field and actually have users hit Ctrl-A and Ctrl-C… … or display the data in an HTML viewer. Blech.[/quote]
Unfortunately, since I originally answered this 6 years ago, a lot has changed with privacy and the browsers. Support for being able to arbitrarily copy into the users clipboard is now considered a security issue in many cases and the browsers will effectively prevent you from doing this. The thing they pretty much universally let you do is copy/paste text from/to a text field or text area.
Gotcha - I ended up using an HTMLviewer and custom code to display the data for the user to copy.
*needed a quickie app to compile mileage and expenses while I am doing my taxes.