Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

C-k (the most useful command ever) is captured by my browser. Google Chrome.


I'm inclined to think that that's more a bug on their part since Ctrl+K isn't one of those unstoppable key combinations (Ctrl+W, Ctrl+Tab, Ctrl+T, Ctrl+N, Shift+Esc as far as I'm aware are the only ones). Perhaps they just aren't calling e.preventDefault() on their event handlers.

And even for the combinations which can't be captured, the new Chrome platform app API lets you stop those.


In an effort not to totally derail the conversation I guess I'll mention that nearly every browser is going to have some shortcut keys that would map to common emacs functions that will get swallowed by the browser.

But what I'm really wondering: what makes you say C-k (kill-line) is the most useful command ever? This is slightly inconvenient with basic Windows shortcuts (shift+end ctrl+x, approximately). I tend to think one of the functions which isn't trivially replicated in other environments is more useful. Just curious...


what makes you say C-k (kill-line) is the most useful command ever

A little bit of a joke, but it's based on a bias that the best thing you can do to source code is make it smaller. To its ridiculous conclusion wiping out every line leaves you with a program with no bugs. :)


That's actually a pretty big problem with the whole "browser app" thing, isn't it... there are certain key bindings that you just can't have. I wonder if there'll ever be a solution for that. Anything I can think of sounds like it would be a security issue, or annoying. (Having to answer pages asking for permission for certain keybindings... ugh.)


There's actually a simple workaround for that:

See http://support.google.com/chrome/bin/answer.py?hl=en&ans... (Create shortcuts for other apps) which I found via http://stackoverflow.com/questions/7295508/javascript-captur...

All Google Chrome keyboard shortcuts are now not interfering when used in ymacs (C-j, C-k, C-n, C-p, C-t, C-w).


I suppose it could have been developed on a Mac, where a bunch of emacs keybindings are integrated into the OS itself.

I had no problem deleting and re-inserting that above sentence with C-k and C-y, in the textfield, for example. Hell, even C-t works.


The fact that OSX native doesn't use C-??? keybindings for non-unixy behavior is one of the greatest advantages IMO. It's even better than Linux in that regard, because CMD-C/V even copies/pastes from OSX clipboard in the terminal.




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

Search: