What is the impact of changing the keypress event so that it interacts a 'level up' than the key would do natively?

13

A simple example, no code needed:

If I press CTRL + F , the browser automatically opens a search bar on the page.

I made that by pressing CTRL + F it would point to an input inside the system.

I want to put several other controllers, such as changing a boostrap tab with CTRL + TAB , closing a modal with ESC . open the internal help with F11 among others.

Examples:

To navigate between tabs using CTRL + SETA

  var change_tab = function () {
        var map = {37: false, 39: false, 17: false};
        $(document).keydown(function (e) {
            if (e.keyCode in map) {
                map[e.keyCode] = true;
                if (map[37] && map[17]) {
                    var $el = $('.nav.nav-tabs').find('li');
                    $el.each(function () {
                        if ($(this).hasClass('active') === true) {
                            $(this).prev('li').find('a').trigger('click');
                        }
                    });
                }
                if (map[39] && map[17]) {
                    var $el = $('.nav.nav-tabs').find('li');
                    $el.each(function () {
                        if ($(this).hasClass('active') === true) {
                            $(this).next('li').find('a').trigger('click');
                        }
                    });
                }
            }
        }).keyup(function (e) {
            if (e.keyCode in map) {
                map[e.keyCode] = false;
            }
        });
    }

To maximize a form with CTRL + F11 :

var make_full = function () {
        var map = {17: false, 122: false};
        $(document).keydown(function (e) {
            if (e.keyCode in map) {
                map[e.keyCode] = true;
                if (map[17] && map[122]) {
                    $('.fullscreen').trigger('click');
                }
            }
        }).keyup(function (e) {
            if (e.keyCode in map) {
                map[e.keyCode] = false;
            }
        });
    }

The question is simple:

  • This type of practice is considered user friendly ?

  • Is there a problem in replacing the browser's shortcut keys with the keys I want to interact with in my system (EX: CTRL + F to open the search)?

PS: In the case in question the target is an internal system, it is not something to be marketed, I just need whoever it is to use, can do as many things in the shortest possible time, since the system focus is

    

asked by anonymous 27.09.2017 / 17:16

2 answers

10

As a general rule, you should avoid changing the way the browser works so that you do not subsequently have accessibility problems. If your site's audience is restricted and you are particularly aware of the shortcuts, but what if the person is myopic and you have replaced ctrl ++ with something else? Interfering with the operation of browser shortcuts can cause setbacks for those who depend on them.

I believe that the path Google uses in applications such as Gmail, a question mark for help overlay, and shortcut combinations that do not run over those defined in browsers, is the safest overall output.

An exception would be for functionality that replicates that already implemented by the browser: ctrl + f to use the application's internal search, ctrl + z to undo a change interface, etc., as long as it does not preclude its use in standard controls, that is, keep the "original" ctrl + z when the user is typing in a form field.

In this way, users who spend all day in your application will have life-shortcuts that will not interfere with your browsing habits in other environments, while maintaining the standardization of known combinations. Who does not hate the fact that every text editor on the planet has its specific shortcut to redo : ctrl + y , ctrl + shift + z , ctrl + r ...

Some references ...

23.10.2017 / 20:40
2

I'm trying to help because nobody from UX has tried to help so far. In my opinion this is not a good practice. The web software I use does not overwrite browser shortcuts, since when we use browser shortcuts we want to use functionality that we already know.

Abs

    
23.10.2017 / 19:59