[Ohrrpgce] Clipboard stuff

Ralph Versteegen teeemcee at gmail.com
Wed Oct 18 15:43:38 PDT 2017


Seems it is pretty simple to peek and wait for the event.

But I 'm not really sure how to handle pasting when the clipboard is blank.
Especially since you can't distinguish between the OS clipboard being
inaccessible, and being blank.

Also, the fact that in the multiline string editor, pasting replaces the
entire existing contents is awkward. We should add selections to the text
editor, so that you press Ctrl+A Ctrl+V to replace the contents.
The standard way to select text by the keyboard seems to be to hold shift
and move the cursor. I prefer the emacs way: press Ctrl+Space... but that's
already mapped to the character picker :(

Oh, in that case you could wipe text with Ctrl+A Delete instead of pasting
in a blank string. So pasting a blank string is less useful.

On 19 October 2017 at 11:27, Ralph Versteegen <teeemcee at gmail.com> wrote:

> I know why working only if you do it twice in a row happens. On X11,
> unlike Windows and Mac, to get the contents of the clipboard you send a
> request to another application and then are meant to wait for the response
> (an X11 event).  To simplify the code (the original calls SDL_PumpEvents
> which I dont' want to do... maybe I can peek at the X11 event buffer
> instead) I just wait 4ms instead. But I realised this is way too little -
> for example the other application might be running running a loop at 30fps
> and only so checks for events every 33ms. I forgot to increase it.
>
> Blanking out text when you paste would happen if the OS clipboard appears
> to be empty (because of the timeout problem) and the internal clipboard
> (STATIC clip) is also empty because you've never copy-pasted.
>
>
> On 19 October 2017 at 04:33, James Paige <Bob at hamsterrepublic.com> wrote:
>
>> The new clipboard stuff is cool!
>>
>> So far I have only tested on Linux.
>>
>> Copying textboxes and other strings, and pasting them into other
>> documents, e-mail, word-processor seems to work great!
>>
>> Going back the other way seems a little flakey, but I can't tell why yet.
>>
>> Most of the time, pasting something I copied from another application
>> into a textbox does nothing at all.
>>
>> Sometimes it works after I try twice in a row. Once it blanked out the
>> old text, but didn't paste any new text.
>>
>> I haven't figured out the rhyme or reason to when it does and does not
>> work yet. I did not see anything in the debug log.
>>
>> _______________________________________________
>> Ohrrpgce mailing list
>> ohrrpgce at lists.motherhamster.org
>> http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.motherhamster.org/pipermail/ohrrpgce-motherhamster.org/attachments/20171019/f53dce67/attachment.html>


More information about the Ohrrpgce mailing list