This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:tutorials:display:clipboard [2018/09/10 13:41 (7 years ago)] – external edit 127.0.0.1 | en:tutorials:display:clipboard [2025/09/30 17:26 (6 weeks ago)] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| Orx now supports clipboards! We can demonstrate this by allowing the user to paste in some text, and have the text replace a text object. First there' | Orx now supports clipboards! We can demonstrate this by allowing the user to paste in some text, and have the text replace a text object. First there' | ||
| - | Start by using [[en: | + | Start by using [[en: |
| Next, define the Control-V key which is the usual for paste, except in the case of Mac OS X: | Next, define the Control-V key which is the usual for paste, except in the case of Mac OS X: | ||
| Line 47: | Line 47: | ||
| Compile and run, and you'll have a window with a text object like this: | Compile and run, and you'll have a window with a text object like this: | ||
| - | {{ :en:tutorials: | + | {{ tutorials: |
| In the Run() function (or an update function), check for the Control and V keys, call a get from the clipboard, and send the output to the text object: | In the Run() function (or an update function), check for the Control and V keys, call a get from the clipboard, and send the output to the text object: | ||
| Line 64: | Line 64: | ||
| Come back to the Orx game window and press Control-V. The object will take the text from your clipboard. Nice! | Come back to the Orx game window and press Control-V. The object will take the text from your clipboard. Nice! | ||
| - | {{ :en:tutorials: | + | {{ tutorials: |
| If you attempt copy and paste a file, a bitmap, or any other non-textual information into Orx, the clipboard will contain '' | If you attempt copy and paste a file, a bitmap, or any other non-textual information into Orx, the clipboard will contain '' | ||
| Line 92: | Line 92: | ||
| Compile and run. Press Control-C to set the clipboard with the "Hello from Orx." text. Now paste into a text editor to get the text from the clipboard: | Compile and run. Press Control-C to set the clipboard with the "Hello from Orx." text. Now paste into a text editor to get the text from the clipboard: | ||
| - | {{ :en:tutorials: | + | {{ tutorials: |
| - | You can also work with the clipboard in the [[en: | + | You can also work with the clipboard in the [[en: |
| '' | '' | ||