Use standard keyboard shortcuts on OS X

Bug #1779938 reported by Stefan Bethge
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
KiCad
Fix Committed
Low
Seth Hillbrand

Bug Description

No window/app closes with Cmd-W.

Cmd-Q is not the right shortcut for a single window as all windows are collected under one dock icon, so Cmd-Q should always quit all KiCad windows/apps.

This is probably not how it is done on windows and linux but on OS X, KiCad is already behaving as a single application with multiple windows (except for gerbview...), so I think shortcuts should behave accordingly for consistency with most other applications.

A shortcut which should not be overriden by KiCad is cmd-h, which is a system shortcut to hide the current application.

Another shortcut that is overridden is cmd-a (starting pcb calculator) which should select all text in a text field (does work sometimes but sometimes start pcb calculator).

Tags: hotkeys macos ui
Revision history for this message
Nick Østergaard (nickoe) wrote :

Please add version info

Changed in kicad:
status: New → Incomplete
Revision history for this message
Stefan Bethge (kjyv) wrote :

Ah, sorry. Kicad 5.0.0-rc3

Revision history for this message
Stefan Bethge (kjyv) wrote :

Application: kicad
Version: (5.0.0-rc3-dev-2-g101b68b), release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.54.0 LibreSSL/2.0.20 zlib/1.2.11 nghttp2/1.24.0
Platform: Mac OS X (Darwin 17.6.0 x86_64), 64 bit, Little endian, wxMac
Build Info:
    wxWidgets: 3.0.4 (UTF-8,STL containers,compatible with 2.8)
    Boost: 1.61.0
    OpenCASCADE Community Edition: 6.8.0
    Curl: 7.43.0
    Compiler: Clang 7.3.0 with C++ ABI 1002

Build settings:
    USE_WX_GRAPHICS_CONTEXT=ON
    USE_WX_OVERLAY=ON
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for KiCad because there has been no activity for 60 days.]

Changed in kicad:
status: Incomplete → Expired
Revision history for this message
Stefan Bethge (kjyv) wrote :
Changed in kicad:
status: Expired → New
tags: added: macos ui
Jeff Young (jeyjey)
Changed in kicad:
importance: Undecided → Low
status: New → Triaged
description: updated
Revision history for this message
Jeff Young (jeyjey) wrote :

Pcbnew, Eeschema, LibEdit and ModEdit all used to be separate applications. Pcbnew and Eeschema can still be run separately today. This makes the water murky enough that I'm not really prepared to change the Cmd-Q / Cmd-W behaviour.

If there are other instances where we don't follow the Mac standards, please include them here.

Changed in kicad:
status: Triaged → Incomplete
tags: added: hotkeys
Revision history for this message
Seth Hillbrand (sethh) wrote :

@Jeff, what if we test for KiFace.IsSingle()?

Revision history for this message
Jeff Young (jeyjey) wrote :

@Seth, we could. I suspect we'd annoy most existing users, but if we believe our user base it growing fast enough it still might be the correct decision....

Revision history for this message
Stefan Bethge (kjyv) wrote :

If Eeschema etc. are run a single application, Cmd-q is ok as is (more expected though would be cmd-q quits application, cmd-w closes window for current open file when also opening multiple files was possible).
If you can detect the single application state, closing e.g. eeschema with cmd-w and closing KiCad with cmd-q. I think it won't take a long time getting used to it even for existing users as it is normal behavior for everything else on macOS, so maybe it fixes their existing annoyance ;). At the moment you have a two step action to quit kiCad (change to the main window and use cmd-q or use cmd-q twice) and can replace it with a one-step way to quit.

Revision history for this message
Michael Kavanagh (michaelkavanagh) wrote :

This will probably handled by https://bugs.launchpad.net/kicad/+bug/1826649 anyway?

Revision history for this message
Seth Hillbrand (sethh) wrote :

This is one of the odd edges that catch folks out when they're using the program. They figure it out but it doesn't feel polished.

I've pushed a proposed fix for this and I'd like to get any feedback positive/negative on how people find it.

Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

Fixed in revision 98124e68c7485d897bb7ed253fff578914b1fd79
https://git.launchpad.net/kicad/patch/?id=98124e68c7485d897bb7ed253fff578914b1fd79

Changed in kicad:
status: Incomplete → Fix Committed
assignee: nobody → Seth Hillbrand (sethh)
Seth Hillbrand (sethh)
Changed in kicad:
milestone: none → 6.0.0-rc1
Revision history for this message
Michael Kavanagh (michaelkavanagh) wrote :

@Seth, this is much better than the current situation. I think technically "Quit" shouldn't be in the File menu on Mac and Cmd-W should be bound to the Close action.

Revision history for this message
Jeff Young (jeyjey) wrote : Re: [Bug 1779938] Re: Use standard keyboard shortcuts on OS X

I like it.

But yes, Quit shouldn’t be put in the File menu (it’s already in the Kicad menu).

And Close should have cmd-W in the menu. (You can probably achieve that by appending \tCtrl+W to the menu rather than having to resort to the accelerator table.)

> On 25 Jun 2019, at 17:15, Michael Kavanagh <email address hidden> wrote:
>
> @Seth, this is much better than the current situation. I think
> technically "Quit" shouldn't be in the File menu on Mac and Cmd-W should
> be bound to the Close action.
>
> --
> You received this bug notification because you are a member of KiCad Bug
> Squad, which is subscribed to KiCad.
> https://bugs.launchpad.net/bugs/1779938
>
> Title:
> Use standard keyboard shortcuts on OS X
>
> Status in KiCad:
> Fix Committed
>
> Bug description:
> No window/app closes with Cmd-W.
>
> Cmd-Q is not the right shortcut for a single window as all windows are
> collected under one dock icon, so Cmd-Q should always quit all KiCad
> windows/apps.
>
> This is probably not how it is done on windows and linux but on OS X,
> KiCad is already behaving as a single application with multiple
> windows (except for gerbview...), so I think shortcuts should behave
> accordingly for consistency with most other applications.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/kicad/+bug/1779938/+subscriptions

Revision history for this message
Christian Conkle (conklech) wrote :

Echoing others: the current patch unfortunately doesn't resolve the issue as stated, because the expected command-W accelerator is not assigned. With command-Q reassigned there is currently no shortcut to close a window.

Also, there are other windows (e.g. Assign Footprints, Spice Simulator) that should also be updated. Assign Footprint has no shortcut currently. Spice Simulator has an "Exit Simulation" menu item, which should probably be renamed.

Bikeshedding: The menu item should probably be "Close Window" rather than "Close." A quick poll of the applications running on my Mac suggests that's the normal text. (Apple's own Mail.app is the exception.)

Seth Hillbrand (sethh)
Changed in kicad:
status: Fix Committed → In Progress
Revision history for this message
Ian McInerney (imcinerney) wrote :

The Assign Associations dialog will be getting the escape key added as the exit key, so it shouldn't need the cmd shortcut key added to it.

Revision history for this message
Stefan Bethge (kjyv) wrote :

Even if escape is added to that window, cmd-w is the default for closing pretty much any window on macOS. It should also be closing any window in KiCad on macOS.

Revision history for this message
Ian McInerney (imcinerney) wrote :

@Seth, did you mean for the shortcut to work on every OS? It is able to close KiCad on Linux, and that is not a usual shortcut for closing windows. Also, it should be added to the list of invalid hotkeys. I can assign a tool to use that combination (or at least ctrl-Q on Linux, which is how it is mapped) and that will then override the close function.

Revision history for this message
Seth Hillbrand (sethh) wrote :

Yes. Ctrl-W should close windows on Linux and Ctrl-q should quit.

You are right, we should make it banned

Revision history for this message
Ian McInerney (imcinerney) wrote :

@Seth, I never noticed those key combinations on Linux before, but now that you mention it I do see other programs using them. I also note that your current patch only pushed the ctrl-Q behavior and not the ctrl-W behavior.

Where are we drawing the line on the implementation of the shortcuts? Is it just going to be the main windows (eeschema, pcbnew, gerbview, pcb calc, project manager, pleditor, bitmap2component, mod edit, and lib edit)? Or should the dialogs (that do already have the ESC key) get them? Some testing with some other apps on Linux makes it seem that it should only be the main window, so things like the options dialogs, associate footprints, simulation, etc. shouldn't get them.

Revision history for this message
Stefan Bethge (kjyv) wrote :

Just my two cents on linux UI shortcuts: the biggest issue is that they are not consistent between programs, they sometimes work and sometimes don't the way you expect and it's a big plus on macOS in my opinion. So while you're at it, why not make ctrl-w on linux do the same as cmd-w on macOS: close every window, including preferences and simulation etc. (actual dialogs are not really windows I guess).

Stefan Bethge (kjyv)
description: updated
Stefan Bethge (kjyv)
description: updated
Revision history for this message
Jeff Young (jeyjey) wrote :

This got fixed under a different bug report.

Changed in kicad:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.