F1 key in Pcbnew zooms in AND opens help

Bug #1822041 reported by typoknig
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
KiCad
Status tracked in 5.0
5.0
Fix Released
Low
Ian McInerney
6.0
Fix Committed
Low
Ian McInerney

Bug Description

Fresh install of Linux Mint 19.1 Cinnamon.

Kicad version info:

Version: 5.1.0-060a0da~80~ubuntu18.04.1 release build
wxWidgets: 3.0.4 Unicode and Boost 1.65.1
Platform: Linux 4.15.0-46-generic x86_64, 64 bit

Installed Kicad per the instructions here:

http://docs.kicad-pcb.org/5.1.0/en/getting_started_in_kicad/getting_started_in_kicad.html#download-and-install-kicad

When I'm in Pcbnew, Footprint Editor, or Gerber Viewer and I press F1 the screen zooms in as expected, but the help file also opens in my browser and my browser gains focus. I am NOT seeing this problem in Eeschema, Symbol Editor, or Page Layout Editor. All the settings in Kicad are default. No hotkeys have been changed.

Fun fact: The "View" menu in all of the Kicad applications lists zoom in/out as ALT+F1 and ALT+F2. In Linux Mint those hotkey combos are showing all the workspaces and showing the run bar respectively. None of the Kicad applications respond to those hotkey combos. I can't see in Mint's settings that either of those hotkey combos are actually map to any function though, and I have been through the list of hotkeys several times.

Tags: hotkeys pcbnew
Revision history for this message
typoknig (typoknig) wrote :

Forgot to add that it is Kicad version info:

Version: 5.1.0-060a0da~80~ubuntu18.04.1 release build
wxWidgets: 3.0.4 Unicode and Boost 1.65.1
Platform: Linux 4.15.0-46-generic x86_64, 64 bit

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

Please add the complete version information from Help->About KiCad->Copy Version Info.

Are you using Modern or Legacy Toolsets? (Under Preferences menu)

Does this happen in any other app, Eeschema or GerbView for example?

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

I added the version info to a comment last night. Didn't realize at the time I was able to edit the original description, but now I have added the version info to the description as well.

I use the modern toolset, but I did try with the legacy toolset to see if that changed anything, but it didn't.

This does not happen with Eeschema. I haven't tried with any other apps other than Pcbnew and Eeschema, but I will tonight and report back.

description: updated
Revision history for this message
typoknig (typoknig) wrote :

I just checked the other applications:

I am seeing this problem in Pcbnew, Footprint Editor, and Gerber Viewer.

I am NOT seeing the problem in Eeschema, Symbol Editor, or Page Layout Editor

Revision history for this message
typoknig (typoknig) wrote :

Fun fact: The "View" menu in all of the Kicad applications lists zoom in/out as ALT+F1 and ALT+F2. In Linux Mint those hotkey combos are showing all the workspaces and showing the run bar respectively. None of the Kicad applications respond to those hotkey combos. I can't see in Mint's settings that either of those hotkey combos are actually map to any function though, and I have been through the list of hotkeys several times.

Changed in kicad:
status: Incomplete → New
Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

The F1 key issue needs to be fixed. There is not much we can do about keys grabbed by your window manager (Alt-F1). You will either have to disable the key in your windows manager or change the key in KiCad. There are so many windows managers on linux that there is almost no chance of no having a shortcut key conflict.

Changed in kicad:
status: New → Triaged
importance: Undecided → Low
milestone: none → 5.1.1
Revision history for this message
typoknig (typoknig) wrote :

I understand your comment about the number of window managers and hotkey conflicts. However, do you think it would at least be prudent to not conflict with the default hotkeys defined in the most popular Linux distro? Maybe when the F1 issue is fixed the View menu options could drop the ALT modifier?

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

We have a lot of #ifdef's to make the zoom hotkeys and accelerators different on Mac. Also (side issue) the zoom in hotkey Cmd+ doesn't work (Cmd- for zoom out works fine).

How about we scrap these and just have
zoom in = Ctrl +
zoom out = Ctrl -
zoom to fit = Ctrl 0
zoom redraw = Ctrl R

(with associated menu accelerators) for all platforms? These seem to be being adopted by Windows applications nowadays anyway.

Revision history for this message
typoknig (typoknig) wrote :

Even though I'm already used to F1/F2 for zooming, I'm ok with the hotkey for zoom changing. Personally though, I use the zoom hotkeys a lot. I would assume the majority of users do, but I have no data to back that up. With that said, I would like the hotkey to be something very convenient, without a modifier, and easy to locate on the keyboard without looking. The "-" and "=" (the Shift modifier for the "=" key is "+") keys next to the Backspace key could fit this description if keeping F1/F2 is not an option. I'm not sure where the number pad "-" and "+" fit in.

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

Plain + and - without modifiers are already used for switching layers.

Revision history for this message
typoknig (typoknig) wrote :

Oh yeah, forgot about that.

Changed in kicad:
milestone: 5.1.1 → 5.1.2
Revision history for this message
Otto Mikkonen (ottomaani138) wrote :

I'm inflicted by the same bug! Didn't use to have it in previous versions, only since 5.x ( can't remember whether it was already with .0 or only after .1. Currently running .1 ).

--

Application: pcbnew
Version: 5.1.0-060a0da~80~ubuntu18.04.1, release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.58.0 OpenSSL/1.1.0g zlib/1.2.11 libidn2/2.0.4 libpsl/0.19.1 (+libidn2/2.0.4) nghttp2/1.30.0 librtmp/2.3
Platform: Linux 4.15.0-47-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.22
    Boost: 1.65.1
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.58.0
    Compiler: GCC 7.3.0 with C++ ABI 1011

Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=ON
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=ON
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=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
Windsor Schmidt (winferno) wrote :

Affecting me as well since 5.x on Arch Linux. I'm a heavy user of F1/F2 keys for zooming, so this is quite a nuisance.

When going to Preferences->Hotkeys and filtering the list by "F1" I see only "Zoom In" listed. I'd expect this to work like any other key-bound feature, i.e. a single feature per binding. Incidentally, the list of hotkeys on my system doesn't include an entry for the online help system.

----

Application: kicad
Version: (5.1.0), release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.64.1 OpenSSL/1.1.1b zlib/1.2.11 libidn2/2.1.1 libpsl/0.20.2 (+libidn2/2.1.1) libssh2/1.8.1 nghttp2/1.36.0
Platform: Linux 5.0.7-arch1-1-ARCH x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
    Boost: 1.69.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.64.1
    Compiler: GCC 8.2.1 with C++ ABI 1013

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

Revision history for this message
Windsor Schmidt (winferno) wrote :

Commenting line 167 of pcb_edit_frame.cpp "fixed" this for me. Patch against the 5.1.0 tag:

diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp
index 97db1e470..979f154e1 100644
--- a/pcbnew/pcb_edit_frame.cpp
+++ b/pcbnew/pcb_edit_frame.cpp
@@ -164,7 +164,7 @@ BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME )
     EVT_MENU( ID_MENU_PCB_EDIT_TEXT_AND_GRAPHICS, PCB_EDIT_FRAME::OnEditTextAndGraphics )

     // Menu Help
- EVT_MENU( wxID_HELP, EDA_DRAW_FRAME::GetKicadHelp )
+ // EVT_MENU( wxID_HELP, EDA_DRAW_FRAME::GetKicadHelp )
     EVT_MENU( wxID_INDEX, EDA_DRAW_FRAME::GetKicadHelp )
     EVT_MENU( ID_HELP_GET_INVOLVED, EDA_DRAW_FRAME::GetKicadContribute )
     EVT_MENU( wxID_ABOUT, EDA_BASE_FRAME::GetKicadAbout )

Changed in kicad:
milestone: 5.1.2 → 5.1.3
Revision history for this message
Oleg Endo (oleg.endo) wrote :

I can see that too. Also in eeschema.

Application: Eeschema
Version: 6.0.0-unknown-cbea514~86~ubuntu18.04.1, release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.58.0 OpenSSL/1.1.0g zlib/1.2.11 libidn2/2.0.4 libpsl/0.19.1 (+libidn2/2.0.4) nghttp2/1.30.0 librtmp/2.3
Platform: Linux 4.15.0-50-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.22
    Boost: 1.65.1
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.58.0
    Compiler: GCC 7.4.0 with C++ ABI 1011

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

Changed in kicad:
assignee: nobody → Ian McInerney (imcinerney)
Revision history for this message
Ian McInerney (imcinerney) wrote :

This issue has diverged between master and 5.1. (The original reporter was on 5.1 and Oleg is on master)

* In 5.1, the issue only exists inside pcbnew, gerbview and the footprint editor (not eeschema, symbol editor or the page layout editor).
* In master the issue has now regressed into every program (pcbnew, gerbview, footprint editor, eeschema, symbol editor and page layout editor).

As a fix, I am going to move the help launcher into an action so that it can be given a user-definable hotkey and then also appear on the hotkey map. That way the duplicate hotkey checker will flag if anything else shares it as well.

The larger issue is still what should the default hotkey for help be. Since F1 didn't launch help in the past, we could make the default another key like Shift+F1 (since Ctrl+F1 lists the hotkeys) without throwing off too many users (or at least fewer users than changing the zoom key would).

Revision history for this message
jean-pierre charras (jp-charras) wrote :

We do not have a lot of available hot keys, so I am not thrilled by this idea, if it can be avoided.

I do not see this issue on my computer, but I am guessing there is a incorrect management of some hotkeys.

the Help menu has a menuitem id = wxID_HELP (a stock id from wxWidgets).

Could you change this id by an id specific to kicad (for instance add in id.h ID_KICAD_HELP and use it as menuitem id in all places using wxID_HELP, and see what happens.

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

@JP, this definitely relates to how the wxID_HELP events are generated and handled. From what I can tell, wxWidgets will generate this event for the program when specific actions are taken (one of which is pressing the "help key" on the system, which is usually F1 and doesn't seem to be user definable). This is unfortunately buried in the wxWidgets code, so the only way to deal with this is to disconnect the handler for wxID_HELP.

We could simply move the help functions to a new kicad-specific ID, which would completely isolate the help access, but then there would be no keyboard shortcut to get into help. In my opinion it would be ideal if it were possible to have actions that have no default hotkey, but can still get assigned them from the user (so hotkeys can be completely disconnected from an action). Then we could ship help with no hotkey and let the user decide if they want one.

For 5.1 the easiest fix is probably to just move to the new ID and disconnect wxID_HELP, but for 6.0 it might be best to explore the action idea provided the revamped hotkey infrastructure allows for the empty hotkey.

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

@Ian, try moving it to an ACTION (they don't have to have hotkeys), and then map wxID_HELP to the ACTION in TranslateLegacyId().

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

wxWidgets handles it's own internal command IDs (wxID_XXXXX) separately from user defined IDs. This is to allow wxWidgets to handle platform specific short cuts for common command actions such as save, copy, help, etc. If you choose to use a hotkey that is already assigned to one of the wxWidgets command IDs, you are always going to have this behavior because wxWidgets will intercept these IDs first. This is described in the event handling overview in the wxWidgets documentation[1]. There are two ways to fix this. Use a new help ID or change the zoom in hotkey to another key. The latter still has a issue if someone decides to use the F1 key for something else.

[1]: https://docs.wxwidgets.org/3.0/overview_events.html#overview_events_processing

Changed in kicad:
status: Triaged → In Progress
Revision history for this message
Ian McInerney (imcinerney) wrote :

This patch is for the 5.1 branch to make opening the help into an action with no hotkey. This disconnects the wxID_HELP event from all pcbnew/module editor/module viewer/gerview windows so that the F1 key no longer has a conflict.

I will work on a patch for master next.

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

@Ian, I merged your 5.1 patch into the 5.1 branch. Thank you for your contribution to KiCad.

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

Fixed in 71f5f96e64f84c6916e92941c05497c982943696

tags: added: hotkeys pcbnew
Revision history for this message
Ian McInerney (imcinerney) wrote :

This was fixed by Jeff on master in this commit: 5e49517781705f11c4c046e13dac8815b535b2c5.

Changed in kicad:
status: Fix Committed → Fix Released
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.