Closed cpsdqs closed 7 years ago
if you want "slow pasting", the text upload tool already implements that, with delay settings and everything
yeah, point was that pasting normally would also use it
After some testing I found out:
copy
, cut
, paste
) work fine without inputse.preventDefault()
on keydown
eventse.preventDefault()
on keydown
eventsPossible solutions:
It's perfectly okay to hack the library I think, if that helps
On Sep 16, 2017 9:52 PM, "cpsdqs" notifications@github.com wrote:
After some testing I found out:
- clipboard events (copy, cut, paste) work fine without inputs
- clipboard events do not work if you call e.preventDefault() on keydown events
- keymaster calls e.preventDefault() on keydown events
- ∴ clipboard events do not fire
Possible solutions:
- don't fix this and let pasting just send a bajillion key events
- write something like keymaster that's less messy and make that not block clipboard events
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/espterm/espterm-firmware/issues/170#issuecomment-329991063, or mute the thread https://github.com/notifications/unsubscribe-auth/AB8lHtgqF1O4it-Nx2RdlzR_f3yddQ3Gks5sjCb1gaJpZM4PWYUb .
I've already modified it anyway (was missing some function keys)
On Sep 16, 2017 9:55 PM, "Ondřej Hruška" ondra@ondrovo.com wrote:
It's perfectly okay to hack the library I think, if that helps
On Sep 16, 2017 9:52 PM, "cpsdqs" notifications@github.com wrote:
After some testing I found out:
- clipboard events (copy, cut, paste) work fine without inputs
- clipboard events do not work if you call e.preventDefault() on keydown events
- keymaster calls e.preventDefault() on keydown events
- ∴ clipboard events do not fire
Possible solutions:
- don't fix this and let pasting just send a bajillion key events
- write something like keymaster that's less messy and make that not block clipboard events
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/espterm/espterm-firmware/issues/170#issuecomment-329991063, or mute the thread https://github.com/notifications/unsubscribe-auth/AB8lHtgqF1O4it-Nx2RdlzR_f3yddQ3Gks5sjCb1gaJpZM4PWYUb .
well I would hack the library but I can't deal with code that indecipherable xD ...well, I can, but it'd take forever. It took me an hour to figure out the clipboard event situation.
i sense a new side project coming :P
well, I did more or less unintentionally make a side branch by unifying input events (such that all input goes through the soft keyboard input and the terminal border dims when it's not focused) thinking it would enable input events but very well, I shall write a keyboard event manager ...actually, I might just refactor term_input and put it in there
i was thinking if you made it work as a js library that's better than keymaster (bc it kind of sucks for some things) that might be quite popular
nah, this is just tedious, not complicated; and all the specific features required here would need to be generalized to everything and that's too much work and I can always migrate later
riight well i would still hack keymaster but you like your es6, so go ahead :P
Added clipboard shortcuts (https://github.com/espterm/espterm-front-end/commit/97e08e71bd19ee61330b2ee15fc22c0ccf1edfa4), and on macOS ⌘C (which isn't overridden by the key bindings) actually works as expected. Pasting currently just uses s[string]
.
Next part: TermUpl and the clipboard should share the same pasting API lest it be duplicate code.
there are some quite important settings in the upload tool tho. eg. if you paste a long file without delays, it (a) can hog the server, and (b) the target application may not keep up
so i propose the upload dialog opens automatically when you try to paste a multiline (or longer than X) text
ofc you dont see this without the hardware. should I mail you one esp8266? :P
I feel like there's more to it than just taking an ESP8266 and connecting it to USB? xD Also, what should be max length for normal pasting? And should normal pasting be bracketed?
I'm working with this one, so. yeah, just plug it in USB :P
and the flashing tool works on mac i think. building the firmware is a bit trickier ...
All pasting should be bracketed when bracketed paste is enabled (the application asks for it) and the Long Length .. like, idk really
the paste tool splits long lines by 100 chars (?), you can't send more than that in one go or the websocket gets all messed up (idk what's going on there, it's written in C and full of pointers)
it is done and it works https://github.com/espterm/espterm-front-end/commit/9dee9e16286e39a17c44c31b66bb84b4622d44ee (probably)
will test that tmw but looking at the code, lgtm
no comments probably means no issues; hereby closed
no comments mean I forgot about it :P
whoa whoa it works
i can even paste with middle-click, ctrl-shift-v and shift-insert
huh. Blame your browser xD
oh no that's the intended behavior. I'm surprised it works so well
what doesn't work is ctrl+insert that should copy (that i think is trivial to add, but not really important), and copy-on-select to X clipboard, but that's probably impossible with javascript (and of course shift-delete that should Cut)
yeah can't really cut from a terminal unless you want me to delete those screen cells xD
and if you want copy-on-select you can call copySelectionToClipboard
in selectEnd
, but I feel like that should be an opt-in feature
ah no that would't be right
there are two clipboards on Linux, the X clipboard that uses the middle button and select, and the ctrl+c,v,x one. i think the insert combos manipulate the latter, but I'm not entirely sure, i dont use those normally.
I often have stuff in both at once, it's really handy! and there is also clipboard history, of course
iTerm2:
This would require doing all input through something like the soft keyboard input which supports the
paste
event (the terminal should probably have an unfocused style, too)