The CTRL + e combination on is quite annoying, I'm need to remove the keydown handler.
From chrome the event listener is on textarea:
So I created a script and tested it in devtools:
Array.from(document.querySelectorAll("textarea")).forEach(e => {
const ev = getEventListeners(e)
if (ev['keydown']) {
console.log(ev['keydown'])
ev['keydown'].forEach((row) => {
e.removeEventListener('keydown', row.listener, false)
})
}
})
But the event listener is still there, what was wrong?
EDIT
As @wahoowa suggested, this worked partially, CTRL + E no longer creates the backtick on github.
But it doesn't do the default action on Mac as well. The default action is to jump to the end of line, how can I do the default behavior when CTRL + E is pressed?
document.querySelectorAll("textarea").forEach(e => {
e.addEventListener("keydown", ev => {
if (ev.key == 'e' && ev.ctrlKey) {
ev.preventDefault();
ev.stopPropagation();
}
})
})