# Clipboard

Learn how to use Wijmo's Clipboard class to handle custom copy and paste actions in this documentation topic

## Content


The __Clipboard__ class allows you to customize the behavior of the clipboard by modifying its contents using the static methods __copy__ and __paste__.

__Note__: The __Clipboard__ class cannot initiate clipboard operations; it can only modify the contents of the clipboard after an operation has been initiated by a user.

The code below listens for the keydown event and checks the keystrokes for __copy__ and __paste__ operations. The __copy__ method takes a string as an argument, while the __paste__ method takes a callback function, and copies and pastes text.

>The __paste__ method only works if invoked immediately after the user pressed a clipboard paste command (like 'ctrl+v')

##### Example
```javascript
rootElement.addEventListener('keydown', function(e) {

  // copy: ctrl+c or ctrl+Insert
  if (e.ctrlKey && (e.keyCode == 67 || e.keyCode == 45)) {
    var text = this.getClipString();
    Clipboard.copy(text);
    return;
  }

  // paste: ctrl+v or shift+Insert
  if ((e.ctrlKey && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45)) {
    Clipboard.paste(function (text) {
      this.setClipString(text);
    });
    return;
  }
});
```


