0

As is described in Github - keyboard shortcuts, s is a shortcut for focusing the search bar. Is it possible to disable that feature?

0

1 Answer 1

0

With modification of this comment

Install Grease Monkey (FF) and use this script

// Your code here...

// ==UserScript==
// @name           Disable keyboard shortcuts
// @description    Stop websites from highjacking keyboard shortcuts
//
// @run-at         document-start
// @include        *github.com*
// @grant          none
// ==/UserScript==

keycodes = [83] // Keycode for 'S', add more keycodes to disable other key captures

document.addEventListener('keydown', function(e) {
//    alert(e.keyCode); //uncomment to find out the keycode for any given key
    if (keycodes.indexOf(e.keyCode) != -1)
    {
        e.cancelBubble = true;
        e.stopImmediatePropagation();
    }
    return false;
});

Or Download TamperMonkey (Chrome) and use this script

// Your code here...

// ==UserScript==
// @name           Disable keyboard shortcuts
// @description    Stop websites from highjacking keyboard shortcuts
//
// @run-at         document-start
// @include        *github.com*
// @grant          none
// ==/UserScript==



document.addEventListener('keydown', function(e) {

     if (e.keyCode == 83) {
        e.cancelBubble = true;
        e.stopImmediatePropagation();
    }
    return false;
});

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .