44

When editing a post, the key combination CTRL+Enter submits the changes made to the post, however, for the form submitting the post to begin with (both asking and answering), CTRL+Enter does nothing.

Can that be changed? CTRL+Enter is a well known combination for submitting forms from within a textarea which supports multiline text.


Note: Whether or not CTRL+Enter is the right keyboard shortcut for the job is not what's up for discussion here. CTRL+Enter is already being used for edits on a form that looks identical to the ask/answer form.

21
  • 52
    Seems like a reasonable request, but will likely lead to many prematurely posted questions, just like it leads to prematurely sent emails (I’ve had to disable that shortcut in my mail client). Commented Mar 24, 2019 at 20:21
  • 11
    It would be trivial to write a userscript that could achieve this, but like @Cris I'd prefer there being no chance at all of accidentally submitting a question/answer/edit before I'm sure I'm ready. Commented Mar 24, 2019 at 21:42
  • 10
    heh. meta.stackexchange.com/a/242605/213575
    – Braiam
    Commented Mar 25, 2019 at 2:43
  • 1
    @CrisLuengo Do you get many prematurely posted edits? Or comments?
    – Madara's Ghost Mod
    Commented Mar 25, 2019 at 7:45
  • 6
    I do get quite a few incomplete comments posted, but that is a fat finger on tiny phone keyboard issue (plain “return” posts the comment). Commented Mar 25, 2019 at 12:40
  • 13
    Huh, not that I doubt you at all, but I wasn't aware of this technique/convention! I'm used to Shift+Enter for forcing newlines when I'm not sure whether Enter will cause a submission. I probably got used to using the mouse to force a submission, or I haven't encountered many forms with textareas. Note that the one I'm writing in now submits on enter. Commented Mar 25, 2019 at 13:40
  • 7
    Anyway, all that aside, yeah this should be consistent in whichever direction. Have a +1 Commented Mar 25, 2019 at 13:40
  • 2
    Just tab your way through the form, no need for fancy shortcuts IMO ;)
    – Lino
    Commented Mar 25, 2019 at 13:53
  • @LightnessRacesinOrbit Been using ctrl+enter for over a decade -particularly in email/chat applications. Maybe it's a windows convention?
    – canon
    Commented Mar 25, 2019 at 14:17
  • 2
    I would not expect "enter" (or any key/key combination) to submit a form that has a "submit" button unless my focus (via tabbing or whatever) is on that key. Otherwise I would consider it a UI/UX bug. For forms without a submit button (e.g. Facebook), then enter/spacebar is the logical choice to submit (and it even indicates that via tooltip and placeholder text, IIRC).
    – TylerH
    Commented Mar 25, 2019 at 14:55
  • 1
    @canon Like TylerH I've been Windows for decades - I'm sure it's "just me"! (read: "just me and TylerH and probably some other people") Commented Mar 25, 2019 at 15:18
  • 3
    @TylerH in my teens, 20 years ago :(, I spent a month or so without a mouse; so, I became more familiar with keyboard navigation and shortcuts than most, I'd guess.
    – canon
    Commented Mar 25, 2019 at 15:54
  • 1
    @TylerH I would never expect spacebar to submit a form on a webpage. That would make it ratherawkwardtotypethings :P I do expect spacebar to press the currently-focused button in a dialogue box (but in the OS or a program, not on a webpage).
    – Clonkex
    Commented Mar 25, 2019 at 21:40
  • 2
    I've never heard of ctrl+enter to submit. I don't want to say you're wrong (because I really don't know anything about it) but this is news to me.
    – Clonkex
    Commented Mar 25, 2019 at 21:40
  • 2
    Just to note: some applications on macOS (e.g Slack) actually uses this short-cut for the inverse effect, i.e to add a new line, when orphan Enter submits. I agree the most common shortcut for this action is Shift+Enter though.
    – Kaiido
    Commented Mar 26, 2019 at 7:44

1 Answer 1

15

This would be good, except for the danger of accidentally using this keybind while typing. Maybe you meant to hit shift+| but missed with both hands and got ctrl+enter. Or accidentally lean on ctrl, or your cat does? I don't think that's happened to me, but it seems plausible enough, and the downside large enough, to not do this for posts, only edits.

A prematurely-submitted edit is generally only a small problem. Edits can be rolled back, or you can make another one within the 5-minute grace period and have it merged. And by its very nature, chances are that the post is still in non-terrible shape at that point. It's also common to make a small edit, so the extra time to grab the mouse again and click "submit" often would be a much larger fraction of the total process than for writing a new post. A second edit to an already-old post is very different from the initial post vs. first edit.

Accidentally posting a new post is bad. It will appear at the top of people's "new questions" feed / search-result page then, while it's maybe still only half written. The couple minutes right after posting is the prime time for reader attention to new posts, especially questions. It's very bad to waste that time with a half-finished post, and then hope for attention when the post is later finished. (Both for the benefit of your post, and for the benefit of people whose time you'd waste.) Plus it will attract downvotes if you don't leave a comment right away, and/or delete it while you finish editing.

More people look at new posts (especially questions) than look at edits.


Submitting a new post with the keyboard only:

  • Tab moves the keyboard focus to the "post your answer" button
  • Enter pushes that button.

This is slightly less dangerous than ctrl+enter because it takes 2 keystrokes in sequence. But it's nearly as fast, and doesn't require touching the mouse.

(edit: yup, that really did work to post this answer. But of course I submitted this edit with ctrl+enter because that's even better.)

3
  • 3
    On the contrary, Tab and Enter (or Tab and Space) are much more plausible to cause a mistake in my eyes, if I am stuck in "code editor mindset" and think that Tab would indent my code (Tab, typing stuff without looking, space submits the question). This happens to me more times than I could count in chat, especially back when "Backspace" was a browser shortcut for the back button.
    – Madara's Ghost Mod
    Commented Mar 26, 2019 at 9:13
  • @MadaraUchiha: That's a fair point, especially tab+space, but usually when I hit "tab" for the first time, I'm looking to see how far it indents and whether that was the right amount. So I notice that it moved the focus before pressing another key. (re: backspace: I detest sites that remap ctrl+backspace to browser-back, discarding the text I've typed! I don't see how that's any easier than alt+left-arrow. IIRC, facebook does that, and maybe also for control+left-arrow, too, also breaking delete-backwards-word via ctrl+shift + left-arrow to select a word.) Commented Mar 26, 2019 at 9:25
  • 2
    @MadaraUchiha: Just happened to me exactly that way copying a prepared code snippet from the VBA editor and fine-tuning it in SO. Tab: "Oh, it didn't indent" -> Space, Space, Space: "Ooops..." Commented Mar 27, 2019 at 8:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .