I need to handle the events undo and redo myself when a user selects undo/redo from context menu or presses ctrl z in a textarea. How can i prevent the default behavior and
You can detect ctrl+z on keyup() with:
ctrl+z
keyup()
var ctrlZ = e.ctrlKey && e.which === 90 if (ctrlZ) { ... }
And context menu on mousedown() with:
mousedown()
var rightClick = e.which === 2 if (rightClick) { ... }