Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: Please stop overriding standard browser navigation keys with Javascript.
99 points by doomlaser on Oct 10, 2011 | hide | past | favorite | 56 comments
Google, I"m looking at you. Google.com changes the behavior of the cursor keys in input boxes to a behavior inconsistent with the rest of the Web and the rest of host operating systems.

Moreso, Google will capture and change the expected behavior of the arrow keys for scrolling.

Today I noticed that Google.com has overrided backspace, a shortcut for "Back" on every browser, including Chrome.

This is not cool. I use a laptop and rely on consistent behaviors of keyboard navigation on the web. I don't want to have to have to learn different (shoddily) implemented navigation patterns every time someone decides to change something.

This is a bad trend in my opinion. What does HN think?




IMO backspace as a shortcut key deserves to be overridden. I can't tell you how many times I've accidentally left a page while typing backspace after losing focus in a form I thought I was editing.

If I were Google, I'd rather reduce the potential for negative experiences from shortcuts for my customers, most of whom I'm guessing rarely use them.

Also, how are the cursor keys being overridden in a non-standard way? Every input box on Google Search feels intuitive to me.


If Google wants to take a stand and change the behavior of backspace, they should do it in their browser. What they should not do is implement a standard keyboard navigation at the browser level, and then override it with nonstandard actions occasionally.


I agree. What's running inside the browser (ie., the webapp) should never be allowed to override the browser itself.


> IMO backspace as a shortcut key deserves to be overridden.

Absolutely. That shortcut has screwed me up so many times I can't even count. I found a way to disable that function entirely in Firefox. If anyone else wants to do the same, you just change the browser.backspace_action setting on the about:config page to 2.


Completely agreed on backspace; Alt/Cmd+Left already covers it well enough. (I've been having a similar problem with two-finger swipe pageback in Chrome anytime I need to scroll horizontally.)


Modifier key + swipe would really help prevent accidental navigations, IMO.


IMO, backspace key is there, just like any other button. If you don't want to press it, don't.

If it bugs you enough, I'll write a chrome extension to turn it off.


Real people demonstrably do not care about keyboard navigation. Ctrl-C makes you anomalously good with computers! Given that real people are worth billions and don't run AdBlock I would optimize for their use rather than that of HN posters, too, if I ran Google's UI team.

In particular, I have always considered backspace in browsers to be a misfeature, which should have been killed in the mosaic era the first time someone who didn't understand "focus" failed a task because of it.


I don't understand your first line: if real people don't care about keyboard navigation, why do we care what the keyboard navigation is for those people, and not for people who do use it? Power users use keyboard shortcuts, so make it work for them. Also, consistency is king in UI design, that doesn't change because we're talking about 'real people'.


We should care about backspace, specifically, because for the 99.9998% of the population that does not routinely use it for Back it is only a source of costly, frustrating errors.

"Consistency is king in UI design" gets mentioned in a lot of books. So do tarot cards. I don't have good experimental apparati for disproving tarot predictions but UI consistency has been judged in the A/B test crucible numerous times and frequently been found wanting.


Just a note, consistency is not always the king. Context is often more important, which is usually neglected by designers. Although I agree this is not the case, and no one should override browser shortcuts until he's got a killer reason for it.


1. I hate, hate, hate that the backspace key is a shortcut for "back". I have never, not once hit the backspace key wanting to go back to the previous page.

2. I'll generally give the bigger players like Google some lee-way in trying out new functionality like this. It's the smaller sites that should generally stick to familiarity (except for the handful who are making a point of exploring behaviors).


1. I do it all the time. Shift-backspace happens to mean forward too. ;)


Most of the times I hit backspace is when I am filling out a form and the idiotic browser behavior of going back a page blows away all of my input. It is beyond infuriating.


If you're using safari, then press forward right away because your form data will still be there.


I use it all the time. It is also the Windows Explorer shortcut for backward navigation. I can't recall ever having a problem using this key for this purpose.


The re-binding of the arrow keys in particular has been driving me insane. The different behavior for backspace I can live with, but I keep finding myself trying to scroll search results with the up/down keys and reverting to using the mouse when I'm surprised to find it does something else.

Glad to see I'm not the only one this has been bugging.


The sad thing is that many sites can't even get basic keyboard support right, and that's something HTML handles quite well.

Classic example is Tab ordering. When I hit Tab, I should reach the most prominent and useful field immediately (almost always a big fat search field). But too often, my first Tab lands me somewhere useless, and if I'm really unlucky it even scrolls me all the way to the bottom of the page to reveal a stupid field in a signup form from an ad or something. 5 or 6 Tabs later I may eventually reach the Search field that was in the top-left corner of the page.


Even better - I was recently filling out a form that tabbed in such an incomprehensible manner that I think the tab order number was used to count fields as they were added.

For those of us who breeze through signup forms with Olympic speed, it's sort of like Garfield getting out of bed and stepping on to a cold floor.


HN's edit form is no better. Pressing Tab after editing a comment takes you to the "help" link in Chrome.


This riles me up so much. Google is the biggest offender in remapping standard arrow keys. I hate Google Instant with passion because it remaps the arrow keys to its stupid chunking navigation. If it's not for the setting to turn it off, I would have gone off to bing or ddg. Still the setting to turn it off is reset every couple weeks, extremely annoying.


YES! I hate the arrow key "feature" on Google's search results. I expect arrow keys to scroll the page, because that's how it works on every other website!


What is the arrow key feature? Over here the up and down keys just scroll the page.


its basically using the up/down keys to navigate through the search results.


This is my biggest peeve with Google as well. I can live with the back button being remapped, but taking over the arrow keys are an absolute nightmare. I refuse to disable javascript because google think they know what should happen when I hit the arrow keys.

A close second: Not mapping forward slash for "search in page" in chrome. This is the single most requested feature in chrome that the devs refuse to implement (see issues 90 and 150 on the chromium projects bug tracker).


I actively avoid using Google Image Search because they've hacked up keyboard navigation and even basic page scrolling with so many custom interactions.


This is yet another reason that I disable javascript altogether in my browser. Only on those websites that absolutely require it to function do I enable it. Unfortunately, more and more websites rely on it.


Up voting this, because - I'm also tired of keyboard shortcuts being messed with. I use space as a pager, in the browser - and this feels broke sometimes in gmail.

I don't like backspace as back, but it shines like the spacebar in being a big key that does not require a simultaneous key press.


I use my backspace-key zu back-navigate very often. Very Often. Until I stumble upon a Google Searchtesult page.... ugh. Why I like my Backspace-Key to go back? Because beside its name, its right above my returnkey and switching to a URL to read something up and then quickly get back is a nice feature. Yeah ALT+CURSOR_LEFT works too, but that are two Fingers I have to positionate to hit the correct key while backspace is just 1cm moving of my index finger.


I don't see keyboard navigation as being standard, and what seems to be standard isn't very good. Perhaps browsers should have an option to limit JavaScript's ability to override keystrokes used in navigation. I use Pentadactyl, a vi-like keyboard navigation plugin for Firefox, which doesn't seem to be plagued by this problem. I learned about it here on HN.


I would settle for a way to see mappings. Browsers already have to know what the mappings are in order to support them, they just don't share that information with users.

In a menu, all I have to do is read to find out what the keys are for each command. Much like each browser has a Back button, it'd be nice if all browsers could agree to provide a "legend" displaying the keystrokes that a web site has defined.

Of course, once the browser can display the mappings it can offer a more sophisticated way to disable them. For example, checkboxes for each key so you can keep the ones you like but get rid of the stupid ones.


> Browsers already have to know what the mappings are in order to support them, they just don't share that information with users.

Unfortunately the way this works in the DOM makes that undecidable. An arbitrary piece of JS code from the web page gets invoked for every keystroke, if the page code has added a handler for key events. If it has not called cancelDefault() on the event object by the time it returns, the browser takes the default action. The question of whether or not user JS code will invoke cancelDefault() for a given event is equivalent to the halting problem.


>I would settle for a way to see mappings. Browsers already have to know what the mappings are in order to support them, they just don't share that information with users.

It's not that simple- the onkeypress event fires every time a key is pressed. What the function handler actually does is non-deterministic. The web app would have to somehow declare its keyboard shortcuts.


Sounds like this is a good opportunity for a Chrome Extension :)

(BTW, backspace does nothing for me on Chromium 14 and Linux)


A Chrome extension to make yourself accidentally back out of webpages from time to time? Funny.


No, an extension to maintain native keyboard binds. Though I like ur idea better...

setInterval(history.back, Math.random()*6000000);

Random time less than 10 minutes sounds good? :)


Even iTunes is guilty of this (on OSX of all places!). Try to edit a songs info and use the normal CMD+Arrow to navigate to Home/End, it will move to the next song. Completely inconsistent and from within Apple on an Apple OS!


As a metadata fascist, this drives me nuts. However, in earlier versions of iTunes (pre-Lion ?), the shortcut was disabled and did neither. I assume they use non-standard text-input.

So it's not exactly the same issue as the Chrome thing: the user assumes this is a text field that implements the standard shortcut, while in reality the text field doesn't answer and the call is redirected to the main iTunes interface.


They used to use vim navigation style instead of arrow keys. They probably changed it to make it more user friendly. Maybe they could allow W,A,S,D navigation as more people are familiar with that.


While it takes some getting used to I'm of the opinion that Google's implementation of this is correct and more usable than the alternative.

The search results are a UI widget and it's reasonable and correct for you to navigate between results with the arrow keys once that control is focused. This is similar to something like a file explorer where the arrow keys select between files or folders rather than scrolling the window.


I have very poor vision and need to zoom virtually every webpage to maximum in order to read it. I use keyboard navigation to scroll around when things don't fit horizontally, so this trend is a source of annoyance to me. While we're at it, I used to think all the fancy layouts you see on the web were annoying, and doubly so now that most of them make everything a hassle for me to use.


I agree that this approach has accessibility implications. Depending on how its implemented and the user intent it can make things either harder or easier. Perhaps, we need a standard key to enable a user to toggle off a page overriding the browser shortcuts. This could either be built into browsers, defined as a standard by the W3C or incorporated into JQuery and other common libraries. The first approach would probably be the best , but also the most unlikely. Maybe the WHATWG would like to take this up, though they may consider it independent of HTML standards.


I actually really like that I can use arrow keys to navigate between links on the Google search page. I'm a keyboard geek and I prefer not having to use the mouse. I especially like that I can say Cmd+Enter and it will open the link in the new tab.

But like others have posted, I have never ever hit backspace either expecting to go back to the previous page.


I suspect it's because of Google Instant (a feature I don't really like), which has to interact with the server every time a key is pressed to ensure that the results are "live".

If you use the gear icon in the top-right of Google.com to go to "Search settings" and turn off Google Instant, it may fix the problem.


Google isn't the only culprit. When Gawker introduced their much-maligned redesign, their sites also rebinded arrow keys to customized interactions like Advance to Next Story. A few months on, and luckily most of these "features" have been removed.

When UX interactions behave consistently at the OS and browser level across 99% of the web, why would I want to see an unpredictable custom behavior on a certain site? I hold Google to an even higher level of responsibility because their actions set precedents that other sites may emulate.


Oh I agree, I was just trying to suggest why Google might have done it.


Somehow the search settings are reset every couple weeks. I hope someone make a Firebox addon to turn off this completely.


This is a browser bug. If you don't want the browser to send keystrokes to the selected page, program it not to.

(I tried to do this in conkeror to override Github's retarded keybinding for "l", but I failed. I don't blame Github, though, I blame my shitty user agent.)


I'm sorry, what? Space is "scroll one page down" on Firefox.


"With great power, comes great responsibility"


Wow, that's my biggest pet peeve on Google. I think this started after Instant and drives me NUTS all the time.


But does it lose data like accidentally hitting backspace does?


No data is lost... if you're doing it wrong and hit backspace, hit 'page forward' to correct your blatant error.


On Firefox with Google's main search boxes featuring autocomplete=off; the input gets erased every time.


I lose data all the time. Maybe I'm stupid.


That depends entirely on the browser.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: