6 ms·
Keyboards and web apps, my post/rant for the year
- darkteflon 3y agoI don’t generally use Google Docs but was surprised to note the other day when using it momentarily with a client that it hijacks Cmd + Shift + R (clear cache and reload tab) on Mac Firefox. Not sure if there are others - I assume so. Truly obnoxious.
- readonlyaccount 3y agoImagine an app without keyboard shortcuts. Web sites.. sorry,apps, not having them is one of the reasons they suck. Please, try and compensate for sucky sites by pretending better that they are apps.
- moritzwarhier 3y agoThe second reason web apps suck is when they have keyboard shortcuts. E.g. Outlook Web hijacks CMD+R on my Macbook, of all things. Wouldn't want to miss CTRL/CMD+K in some web apps though.
- teddarific 3y agoDefinitely one of my pet peeves is when an app overrides a default short cut. Especially one like refreshing the page. I wish there was some sort of universal agreement or API for what short cuts should do functionally.
- hnrodey 3y agoJira hijacks Control+F and directs you towards their custom search functionality. Exactly what I DON'T WANT.
- muxator 3y agoYep, github too is guilty of this sin. I think this is a normal (and unhealthy) consequence of the JS browser APIs keeping expandong. A sort of Greenspuns Tenth Rule Of Programming that happened on the web platform. I am not sure there is a cure. Every successful platform would have been bound to eventually become that.
- zokier 3y agoAWS has this thing that allows you to connect to an virtual machine from the web console, giving you browser based terminal. Very convenient and nifty. Except using ^W to delete word is so hardwired in my muscle memory that I ended up accidentally closing the tab (and losing state) endless times... I don't think its solvable problem That being said, same issue happens, albeit to a lesser degree, with desktop apps where occasionally the DE/WM shortcuts conflict with some applications shortcuts.
- saint_yossarian 3y agoIn Firefox you can enable the ui.key.textcontrol.prefer_native_key_bindings_over_builtin_shortcut_key_definitions setting, but I think you also need to enable Emacs keys in Gtk. With this I'm able to use Ctrl+w normally in the Gitpod terminal, so this might work for the one in AWS as well.
- eyelidlessness 3y agoMy personal annoyance is when they hijack cmd-f to implement custom search functionality. Especially (but not only) when they fail to handle cmd-e and even more especially cmd-g. I even understand why in some cases it’s necessary to provide custom search. For example to implement search over lazy loaded content which hasn’t yet loaded. But it never works as expected, even when it’s done well.
- ehnto 3y agoVimium kind of gets you there. At least, you don't have to move your mouse with it.
- amadeuspagel 3y agoWhat exactly is the problem with the new web APIs? What exactly doesn't work on Firefox and Safari?
- CharlesW 3y agogetLayoutMap(), which Mozilla and Apple initially determined carried a significant fingerprinting risk. I don't know if Apple's position or the spec changed, but caniuse says Safari's Technology Preview does support it, so it's apparently coming there soon.
- JohnFen 3y agoThis is one of the big reasons why I am not on board with the webapp train. In order for them to be realistic replacements for real applications, the API would have to be very robust. And a very robust API comes with serious privacy issues. The web is far too hostile of a place to allow exposure of a robust API to it.
- jrockway 3y agoI suppose the problem is that sometimes you want keyboard shortcuts to be non-arbitrary keys. If you're on dvorak, you wouldn't want WASD to be your movement keys in an FPS. They are nowhere near each other. So applications need some sort of API to figure out what keyboard layout is in use, so they can setup the appropriate bindings. (The OS tells them which letter was pressed, not which (row, col) on the keyboard was pressed. But in this case, you kind of want that raw key matrix event.) This is basically impossible, because the key matrix -> letter translation can be done in multiple places (in the keyboard firmware, in the OS, etc.). Hilariously, sometimes your keyboard firmware has to be aware of the OS translation; you cannot send a & keypress event over USB, so you have to send "shift + 7" if you want a key that generates that input. Because of all this, application developers have to add a "key binding preferences" page to their application. There is absolutely no way they can target a certain physical location on your keyboard. None of this is specific to Javascript, of course. This is all about protocols and the OS.
- csw-001 3y agoHas anyone worked with/built a web app that let's users set let their hot keys? Seems like it should be possible? That way users who like hot keys can just pick the ones they want...
- TonyStr 3y agoThat's a lot of work for satisfying very few people. My boss would not be happy
- jay_kyburz 3y agoI'm normally the first person to say we browsers don't need to be any more complicated, but this is one thing I think would be pretty cool. Website authors could specify a list of [name, callback, defaultKey] and each browser could implement an interface to change the binding locally. There could be a button right in the address bar for both discovering them and changing them.
- ehnto 3y agoIt certainly is possible, it just so rarely shows up in modern web projects. It is not something I have ever seen raised in a UX design meeting or during development. I honestly think it's just lack of awareness. I know it's partly because we warned against jacking native behavior, I think that probably scared people off shortcuts on the web early on. Now we have really complex web apps, but shortcuts are still not being thought about.
- blitz_skull 3y agoThis is a very strange rant. I’ve built keyboard shortcuts for app used by thousands of international monthly users and have never had a complaint about it. Also… “onKeyPress” gives you names for most non-letter key presses.
- crote 3y agoMaybe your users are just used to it? For example, Reddit's rich text editor is broken for me. I cannot type an "é" in it - unless I switch to the manual Markdown mode. Is it annoying? Absolutely. But it only bothers me once every few days and there is a workaround, so whatever.
- pieterbreed 3y agoOne of my users apologised for having an AZERTY keyboard. The people out there suffer us.
- obscurette 3y agoAs international keyboard user – yes, I'm so used that keyboard shortcuts don't work for me that I don't bother to report it. I did it many years ago, but after tens of "we can't do anything about it" answers stopped.
- irrational 3y agoSo, calendars/dates are complex, storing people’s names in a database is complex, keyboards are complex. What else? There are 2 hard problems in computer science: cache invalidation, naming things, off-by-1 errors, and all of the above.
- emmanueloga_ 3y agoSince computers deal with numbers: There are only really two hard problems in computer science: counting.
- edw519 3y agoNice little rant. Reminds me of the president of a software house that wrote inventory software for large commercial warehouses. One of his customers required "Box ID", an essential capability that not only tells you how many we own, but exactly which boxes they are in. Everyone has it today. These people attempted to satisfy this customer, but after a year and nothing to ship (it's not that hard!), they backed out and cried, "We'll never do Box ID again!" I wonder what that guy is doing today. And I wonder what OP will be doing tomorrow.
- pieterbreed 3y agoOP will be sleeping in, eating at the pub nextdoor, looking at Table Mountain on the way back home and playing Dave the Diver in the afternoon.
- 38 3y agoug, nothing worse than web apps capturing my browser interactions. please don't add keyboard shortcuts, don't disable right click, don't capture Ctrl+F preventing me from using the browser search. no, your re-implementation of existing browser feature is not better or even wanted.
- navanchauhan 3y agoEven though Discourse allows you to get the native Ctrl-F functionality by pressing the combination again, I hate the fact that it even captures that in the first place :(
- ecf 3y ago> please don’t add keyboard shortcuts This is entirely unreasonable. Imagine Google docs not being able to offer a shortcut to enable bold formatting, for example. Terrible experience.
- charcircuit 3y ago>don't capture Ctrl+F preventing me from using the browser search. Browser search only searches visible text in the DOM. For performance reasons the whole page might not be loaded into the DOM. This means the default browser search will provide incomplete results.
- 38 3y agoif you cannot load the whole page for any reason, that's a failure of design. use pagination, that has existed since the 90s.
- SuperCuber 3y agodefault ctrl-f will only search through the current page while the site-provided one can search through all content... this is not really an argument against it existing
- 38 3y ago
- pieterbreed 3y agoIf i knew my post would do well on hn I would have posted it here myself. Well played.
- dwg 3y agoConcrete information on Japanese input for your list: For English input, being able to submit comments/chats with the enter key is a feature, but for Japanese (and maybe Chinese?) users it's a bug. In Japanese the enter key is used multiple times to select from multiple possible characters while composing a sentence—it's just how Japanese input works. If an app submits when enter is pressed, it's very difficult to finish typing even a single sentence. Often the only solution is to compose text elsewhere and then copy/paste. There is a solution: check the keyboard event isComposing (https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/isComposing https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEve...) property (alternatively, oncompositionstart and oncompositionend) and only submit if false.
- bastawhiz 3y agoThere's a better solution: wrap your inputs in a form element and rely on the submit event rather than a keyboard event. The browser knows (or should know!) if the user intends to submit or not.
- dwg 3y agoYes, ideally let the browser handle it, and in many but not all cases that is possible.
- folmar 3y agoJust use submit type input and let the UA handle the complexity.
- Flimm 3y agoThank you for sharing this. I had no idea!
- mthoms 3y agoIt seems not very well known that you can actually reclaim your alt/option key on MacOS by using the Unicode Hex Input Source for your keyboard. It's not a particularly useful tip if you every need to type accented characters, but great for the rest of us.