Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System clipboard integration #2

Open
mwisnicki opened this issue Feb 24, 2011 · 2 comments
Open

System clipboard integration #2

mwisnicki opened this issue Feb 24, 2011 · 2 comments

Comments

@mwisnicki
Copy link

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.

@jots
Copy link

jots commented May 17, 2011

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.

@mwisnicki
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants