# How can I deactivate the Ctrl+M shortcut in the editor?

On my keyboard, I programmed CTRLM to be something special, and always when I press CTRLM when I ask a question on Mathematics Stack Exchange, an "Insert Citation" appears! How can I deactivate this "Insert citation"? It's really annoying.

Rob W's answer on Meta Stack Exchange contains a bookmarklet and a user script to disable all of the keyboard shortcuts in the editor.

The answer explains the methodology of the user script, but as is it will no longer work, since Stack Exchange uses https instead of http. You can fix this by changing all the @match lines to something like

// @match          *://stackoverflow.com/*


Also, MathOverflow is not part of the matched sites, so if you ever want to block the keyboard shortcuts on that site you'll have to add a line like

// @match          *://*.mathoverflow.net/*


to the preamble.

Someone better versed than I in user scripts could probably find a way to disable specific keyboard shortcuts.

For completeness, here's the user script with the minor changes described above.

// ==UserScript==
// @name           Cya WMD shortcuts
// @namespace      Rob W
// @version        1.00001
// @match          *://*.stackoverflow.com/*
// @match          *://*.superuser.com/*
// @match          *://*.serverfault.com/*
// @match          *://*.stackexchange.com/*
// @match          *://*.mathoverflow.net/*
// @match          *://stackapps.com/*
// @run-at         document-end
// @grant          none
// ==/UserScript==

(typeof unsafeWindow !== 'undefined' ? unsafeWindow : window).\$(function() {
var p = document.getElementById('wmd-input');
if (!p) return;
p = p.parentNode;
function ignore(e){e.stopPropagation();}