Keyboard shortcuts in editor break standard OSX shortcuts

On OSX, I frequently use the following standard shortcuts that work across all applications:

  • ctrl+e for end of line
  • ctrl+a for beginning of line
  • ctrl+k to copy from the cursor to the end of the line
  • ctrl+y to paste copies made with ctrl+k

Of these ctrl+k and ctrl+y do not work which has been somewhat frustrating since this is the only app I use where they do not work :confused:. This negatively impacts my user experience :frowning:.

This is also true at Stack Overflow with the editor – it’s a shared open source component with default keyboard shortcuts.

There are alternative keyboard shortcuts for doing those functions, e.g. end takes you to the end of line, home takes you to the beginning of the line, etc.

Macbook keyboard doesn’t have these keys, also those keys aren’t very accessible while typing since you have to move your right hand away form home row.

I use CMD+ for home, CMD+ for end.

3 Likes

ctrl + a and ctrl + e for home and end work fine. The problematic override is ctrl + k which normally cuts to the end of the line, but here it brings up template for a link.

If accessibility is a primary concern, why be on a laptop, particularly an Apple laptop which makes many compromises to keep things super thin and light, often to the detriment of repairability or even a functioning keyboard? You can also use external USB keyboards that are specifically designed for accessibility.

1 Like

Strawman arguments?

Not going to help when websites override standard key-binds. Apple didn’t invent these bindings, GNU Readline shares the same bindings. I’m mostly working form Linux so these key-binds work there as well. I’ve only mention OSX because issues concerning Linux users are generally ignored, this particular issue affects both OSX and Linux users.

Your opinion that an external USB keyboard is more accessible is an opinion. In my opinion, having a track-pad located where I can quickly return to home row is more accessible. Having a single keyboard to get used to is more accessible (e.g. when I’m not at my desk with external keyboard). So for me, being able to use my laptops keyboard is the more accessible option. That said, the only reason I use a Macbook is because it was company provided, in the past I used Thinkpads which have better keyboards. Also this Macbook is an several years old now, so the keyboard is actually a decent one. For the reasons you’ve stated in your strawman argument, I will likely request a laptop from another manufacturer when the time comes to replace this one - but doing so would in no way resolve accessibility issues created by websites that override standard key-binds.

Interesting, this is the first time I ever heard of the ctrl+k yank, interestingly the entire Stack Overflow network hijacks this as well, Gmail leaves it alone.

I am very much on the fence here… retranslate all the Hyperlink (Ctrl+K) tooltips rebind to CTRL+SHIFT+K , retrain all the users who use CTRL+K and so on is quite an expensive task.

Can you not rebind the end of line yank to another key or perhaps use a theme component to rebind the shortcut for your site if it is a major issue for you.

3 Likes

Ctrl+K is an os-independent convention for inserting hyperlinks. It applies to various web development suites and even the likes of Microsoft Word. It’s so common that it even has a Wikipedia entry.

If you’re editing a post it’s much more likely you’re going to insert a link than be looking for the other use.

4 Likes

Yes it does :rage:.

IMO, simply typing “[title](URL)” is more convenient than the shortcut “ctrl+k URL tab title return”.

I would appreciate being allowed to customize key-binds on a site or even disabling them altogether.

I believe browser plugins would allow you do that.

That could be true, though I haven’t found one that I can verify isn’t a keylogger :). The plugins I’ve looked at need some disturbing permissions to accomplish this.

For other affected: here is a script for Violent Monkey:

As a bonus, this also fixes ‘find’, which is being overridden by a lot of webpages lately to do a site search instead of a page search (not discourse related at time of posting).

// ==UserScript==
// @name anti key-grabber
// @description Prevent web apps from capturing and muting vital keyboard shortcuts
// @inject-into auto
// @version 1.1
// ==/UserScript==

function antigrab(e) {
  if (! e.ctrlKey) {
    return;
  }
 
  switch (e.keyCode) {
    case 65: // A - goto beginning of line
    case 69: // E - goto end of line
    case 70: // F - find
    case 87: // W - close window
    case 84: // T - open tab
    case 75: // K - kill to end of line
    case 89: // Y - yank
      e.stopImmediatePropagation();
      e.stopPropagation();
  }
}

(function(){
unsafeWindow.document.addEventListener('keydown', antigrab, true);
})();

(inspired by: https://gist.github.com/rodneyrehm/5213304)

Noticed today that gmail has also begun hijacking ctrl+k :crazy_face:.

3 Likes