whscullin/apple2js

Pasting text onto screen no longer works

Opened this issue · 4 comments

I am using Firefox 128.3.1esr, and seem to be unable to paste plain text into the display window. There was a previous closed ticket about pasting text so I assume this is something I should still be able to do? I tested on both the Apple2 and Apple2e emulators but I get the same results -- either a single underscore or nothing pasted at all. Hopefully this is an easy fix?

iflan commented

I just tried it on Chrome and it works. The complication is that I couldn't use Ctrl-V or the context menu. Instead, I had to use the three-dots menu (⋮), then "Find and edit", then "Paste".

Ah! That works in Firefox as well using Edit->Paste. Thanks for the tip, this will at least get me going here (I was hoping to paste in some Applesoft Basic programs). Hopefully we can get a code update to also accept the keyboard shortcuts?

iflan commented

I'm not quite sure how keyboard shortcuts would work since most of the time you want Ctrl-V to actually type Ctrl-V in the emulator. The other option is adding an on-screen button or similar, but that requires asking the browser for permission: https://developer.mozilla.org/en-US/docs/Web/API/Clipboard_API#security_considerations

Hmm that's a good point. I've seen some programs pop up a textarea when you paste something in the window, so that might work to allow a user to verify the formatting before sending the text to the emulator. A custom right-click menu on the monitor div might also be useful, and easier to implement?

Curiously, I just noticed on linux, where middle-click will paste selected text, that this also will paste into the emulator window. So I guess it's only the keyboard shortcuts that are being withheld but mouse options work like we're used to.