Skip to content

System clipboard integration #2

@mwisnicki

Description

@mwisnicki

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions