Default keyboard shortcuts don't work #335

Closed
mit-mit opened this Issue Oct 19, 2016 · 23 comments

Projects

None yet

8 participants

@mit-mit
Member
mit-mit commented Oct 19, 2016

Our default keybindings for hot reload and restart don't seem to work well:

On macOS 10.11.6:

  • Hot reload:
    • Defaults to cmd-F5.
    • This launches the Mac 'VoiceOver' app for me.
  • Restart:
    • Defaults to cmd-shift-F5.
    • This works.

On Linux:

  • Hot reload:
    • Defaults to ctrl-F5.
    • Doesn't do anything at all
  • Restart:
    • Defaults to ctrl-shift-F5.
    • Doesn't do anything at all
@mit-mit mit-mit added this to the external 0.1 launch milestone Oct 19, 2016
@mit-mit
Member
mit-mit commented Oct 19, 2016 edited

Suggestions for new keys. These work for me on both macOS and Linux:

  • Hot reload:
    • Bind to alt-r.
  • Restart:
    • Bind to alt-e (as in rEstart, also conveniently right next to r).

Note: Cannot use alt-shift-r as that is already use for rerunning all tests.

@mit-mit
Member
mit-mit commented Oct 19, 2016

I am wondering if we go with r and e, would we then also change the shortcuts in flutter run. CC @johnmccutchan

@alexander-doroshko
Contributor

Hint: when looking for a vacant shortcut you can open IntelliJ IDEA Ultimate (with all plugins enabled), go to Preferences | Keymap and click 'Find Actions by Shortcut' button. It won't guarantee absence of conflicts with other Keymaps, other OSes and other plugins, but still may help to catch some conflicts.

@mit-mit
Member
mit-mit commented Oct 19, 2016

@alexander-doroshko great tip, thanks. Just checked and the ones I proposed look free. Actually, doesn't look like alt is used much for shortcuts. Is there a reason to avoid using it?

@alexander-doroshko
Contributor

I've heard that Mac OS X by default handles Alt+Letter itself and doesn't delegate keypress to the app.

@pq pq added bug usability labels Oct 19, 2016
@stevemessick
Collaborator

Confirming what Alex said:

I just test alt-r by binding it to Move Caret Backward a Paragraph and that seems to work. (Restart is currently broken in my dev env or I would have tested with that.)

It does not work with alt-e though. That inserts the acute accent prior to performing the keybinding action.

Using alt-anything on Mac may be confusing to people who are accustomed to typing in languages that require accents and other diacritical marks.

@mit-mit
Member
mit-mit commented Oct 20, 2016

OK, new suggestions. Confirmed that these work on both macOS and Linux:

  • Hot reload:
    • macOS: ctrl-z.
    • Linux: alt-z.
  • Restart:
    • macOS: ctrl-shift-z.
    • Linux: alt-shift-z.

Perhaps not the most natural letter, but there are almost no unbound keys left on cmd and ctrl.

@johnmccutchan

ctrl-z is "undo"

@mit-mit
Member
mit-mit commented Oct 20, 2016

Not on a mac; it uses cmd-z.

@alexander-doroshko
Contributor

But you are going to add shortcuts to all keymaps, so with Ctrl+Z you may disable Undo action for Linux and Windows users.

@mit-mit
Member
mit-mit commented Oct 20, 2016

I don't understand, are the keymaps not platform specific? I see lots of
keys being different across the two (e.g., the one for Debug)

On Thu, Oct 20, 2016 at 4:57 PM, Alexander Doroshko <
notifications@github.com> wrote:

But you are going to add shortcuts to all keymaps, so with Ctrl+Z you may
disable Undo action for Linux and Windows users.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#335 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ANAxigTDVAHnZXpPKXMOEtVf_ufcrIb1ks5q14FegaJpZM4KbEok
.

@alexander-doroshko
Contributor

They are if plugin developer cares about it :)
Your current code in plugin.xml contributes the same shortcut to all keymaps.

@alexander-doroshko
Contributor

And on Windows/Linux Keymap choice is much bigger:
image

@pq pq modified the milestone: external 0.2 launch, On Deck Nov 2, 2016
@sethladd
sethladd commented Nov 4, 2016

just ran into this. I started "voiceover" on my mac :)

@johnmccutchan

The default keyboard short cuts in IntelliJ are so bad that I feel like this is going to negatively impact the perception of Flutter.

A great example: CTRL+W does not close the open editor tab/window instead it "expands your text selection".

A good developer experience requires sane and common keyboard shortcuts out of the box.

@johnmccutchan

Just to be clear my comment above is not specific to the plugin itself.

@devoncarew
Member

I suspect they won't blame the Flutter UX for IntelliJ keyboard shortcut choices.

I had some keyboard shortcuts to learn when I started using IntelliJ, but these were mostly things that are IDE actions, with different shortcuts per IDE. The platform shortcuts largely did what I expected. If things are behaving wildly different from what you expect you may want to change your keymap set. I have mine set to the default for the mac platform:

screen shot 2016-11-04 at 11 13 44 am

@devoncarew devoncarew modified the milestone: 0.1.5, On Deck Nov 4, 2016
@alexander-doroshko
Contributor

@johnmccutchan What is your OS / Keymap? Default keymap for Mac is "Mac OS X 10.5+" and it has Cmd+W for closing editor tab and Alt+Up for Extend Selection.

@johnmccutchan

I suspect they won't blame the Flutter UX for IntelliJ keyboard shortcut choices.

@devoncarew I strongly disagree. We are telling our users to download, install, and use IntelliJ with the Flutter plugin. If IntelliJ offers a bad UX, it is our problem.

@alexander-doroshko I run Linux why would I select Mac OS X keyboard shortcuts?

@johnmccutchan

For the record, using Mac OS X keyboard mapping on Linux provides an even worse experience because everything is mapped to COMMAND+ instead of CTRL+. Why does IntelliJ even let users select keyboard map on Linux?

@alexander-doroshko
Contributor

@alexander-doroshko I run Linux why would I select Mac OS X keyboard shortcuts?

Did someone advise you to use Mac OS X keymap on Linux? I do not think it is worth trying. Indeed, unlikely you have Command button. I'm afraid I do not know why there's an option to select Mac specific keymap on Linux.

For closing active editor tab I got used to Ctrl+F4 shortcut, which seems to be pretty common.

As for Ctrl+W that stands for 'Extend selection' I think that the reasons are historical. This action and shortcut were introduced in IntelliJ IDEA in 2000 and I believe at that time Ctrl+W was not that common for closing active tab in other apps. Probably JetBrains doesn't want to change the meaning of this shortcut, in order not to surprise existing users who got used to it.

@devoncarew devoncarew modified the milestone: 0.1.6, 0.1.5 Nov 15, 2016
@raju-bitter

Mac keymap on Linux: Those setups might make sense \if you use a Mac keyboard (e.g. external) with Linux running on a Macbook. Or virtualized Linux running in OS X. But it's still ugly.

@mit-mit mit-mit was assigned by pq Nov 22, 2016
@raju-bitter raju-bitter referenced this issue in flutter/website Nov 23, 2016
Merged

6950 intellij hot reload docs #326

@mit-mit
Member
mit-mit commented Nov 23, 2016 edited

OK, latest (and greatest?) suggestion:

  • Hot reload:
    • macOS & Linux: ctrl-,
  • Restart:
    • macOS & Linux: ctrl-shift-,

Tested with both the 'Mac OS' and 'Default for XWin' keymaps.

@pq WDYT?

@devoncarew devoncarew closed this in #473 Dec 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment