ymacs icon indicating copy to clipboard operation
ymacs copied to clipboard

System clipboard integration

Open mwisnicki opened this issue 14 years ago • 2 comments

It should be possible to handle system clipboard by capturing C-c keydown event and creating almost hidden (ie. 1px*1px) text component and doing select() on it.

I was using keyboard shortcuts library with following code to achieve something similar:

shortcut.add("Ctrl+C", function() {
    var k=document.getElementById("clipboard");
    // populate k with text
    k.select();
}, { propagate: true });

Pasting can be handled in the same way. I have tested this approach on Chrome, Firefox 3.6 and IE8.

mwisnicki avatar Feb 24 '11 20:02 mwisnicki

yeah, that works fine. i did the same thing and can't live without it: http://groups.google.com/group/ymacs/browse_thread/thread/43e397caebcbe355

btw, how do you use the keyboard shortcuts library with ymacs? does it get the keystroke first and then you pass it on to ymacs? i'd like to intercept certain keys before ymacs if possible.

jots avatar May 17 '11 20:05 jots

I didn't use it with ymacs. For ymacs you should probably hack DynarchLib. Unfortunately author does not provide current sources to it but I'm certain he would if someone asked.

mwisnicki avatar May 18 '11 00:05 mwisnicki