How can I detect shift key on paste event

Hi, thanks for this awesome editor!

I have a event handler to transform the content on paste before inserting it. But don’t want to transform the content if the user has the shift key pressed (i.e. ctrl/cmd + shift + v).

The `paste` event is a wrapped event without access to the original event properties (like `shiftKey`, so is there any way to detect this?

In short, I’d like to do something like this:

EditorView.domEventHandlers({
  paste(event, view) {
    const text = event.clipboardData.getData
    const textToInsert = view.shiftKey ? text : transform(text)
    // insert text here
  }
})

It’s not, though. It’s the raw DOM event. But ClipboardEvent objects unfortunately don’t come with keyboard modifier properties. So the best solution (as far as I am aware) would be to use separate keyboard event handlers to track the state of the shift key. This isn’t entirely reliable (you won’t get notified of changes when the window doesn’t have focus), but it’s all the browser gives you.

Oh, sorry for the mistake and thank you so much for the tip. I’ll try that.