How to not change layer when place via

I’ve been struggling with a usability issue, and I’m hoping for a check on my reasoning before I write an issue. (Am I missing something obvious?)

By default, KiCad assumes that when you place a through hole via (default hotkey V) you also want to Toggle Layer (default hotkey also V). I want to be able to drop a ground via (for instance) onto an inner layer that I trust is there without switching to the associated reverse layer.

I assumed it would be as easy as un-assigning the Toggle Layer hotkey, but that doesn’t appear to have worked. (Note that if you follow along at home, you cannot re-assign the same hotkey back to both of the commands. That was mentioned in issue 15812 in passing, probably needs a new issue to emphasize.) There is a similar issue (9165) but I wasn’t sure if that’s the same as what I am dicussing.

To demonstrate:

Start with only the Front Layers preset active, so only the F.Cu and F.* layers should be shown.

Activate routing tool (default hotkey X) and click on a pad. Move mouse away from pad and try to Place a Through Hole Via (default hotkey V). Immediately prior to clicking the mouse, the selected visualization settings remain in effect.

After clicking the mouse once, the layer selection is toggled (so B.Cu is selected and made visible) and I am now continuing the trace on the B.Cu side.

What I’d like is to not have my layer selection or appearance settings changed when I place a via in the middle of routing. I thought that was what Toggle Layer did, but it appears that hotkey is not obeyed in interactive routing mode.

Note that I’m using a nightly / v8 release candidate from a few days ago here (hence the visual glitches) but I think the behavior has not changed since v7.

Application: KiCad PCB Editor arm64 on arm64

Version: 8.0.0-rc3-60-gaf02650689, release build

Libraries:
	wxWidgets 3.2.4
	FreeType 2.13.2
	HarfBuzz 8.3.0
	FontConfig 2.15.0
	libcurl/8.4.0 (SecureTransport) LibreSSL/3.3.6 zlib/1.2.12 nghttp2/1.55.1

Platform: macOS Sonoma Version 14.2.1 (Build 23C71), 64 bit, Little endian, wxMac

Build Info:
	Date: Feb 20 2024 12:47:30
	wxWidgets: 3.2.4 (wchar_t,wx containers)
	Boost: 1.82.0
	OCC: 7.7.2
	Curl: 8.4.0
	ngspice: 42
	Compiler: Clang 15.0.0 with C++ ABI 1002

Build settings:

I don’t know of a way to drop a via while routing, not change layers, and then keep routing.

If you are okay with ending your track, you can drop a via without changing layers by pressing V and then either double clicking or shift clicking, but that completes your track. Maybe it’s still less annoying to start routing again from that point if you haven’t changed layers.

You can also drop freestanding vias, but of course that doesn’t help you if you’re trying to start while routing.

yes this is absolutely a requirement.
In Altium, because commands can be stacked while routing, you can just drop a via with ‘p(lace) v(ia)’ without changing layer, and then just continue.
If you want to put a via down and then change layer, you do not put a via down-
When you change layer via during routing- using + or - key changing active layer, the via is automatically placed and the layer is changed. That’s Altium and it works fast and effective.

I’m not worried about continuing to route on F.Cu, I just don’t want the visibility of the layers to change in the middle of the double click to set a via in place. It seems like on the first click of a double click, the via is placed and layer selection changes to B.Cu (and turns on B.Cu visibility at the same time so you can see a potential trace being made there) then on second click no trace is placed and the layer selection returns to F.Cu but the B.Cu visiblity remains.

I have just confirmed this works (in KiCad-Nightly V8.0.0~rc3) (I don’t have V7 at the moment)

  1. Have a 4 layer PCB.
  2. Have an inner layer as dedicated GND zone.
  3. Start a track on the top layer with x.
  4. Draw a few segments.
  5. Press v to start a via.
  6. Click a location to finalize via location (Layer switches to Back).
  7. Press [Esc]. Cursor detaches from the track, and layer switches back to Front.

This seems like a reasonable way of working. Once the via is connected to the (most often a) GND zone, there is usually no need to keep the cursor attached to the track, and you stay on the top layer on which you were working, to draw the next track.

Oh that’s weird, it makes a difference if you add multiple segments and what shape the segments are in before placing the via. If you start routing and move the mouse without committing segments, you always get the behavior I describe at the beginning where the selection flickers and the changed visibility sticks. With your method, sometimes I got the behavior I wanted (the visibility and selection does not ever change) and sometimes it does the “normal” behavior above.

Probably this is what issue 9165 mentions, I just hadn’t managed to replicate it till now.

Edit: if you route, click to fix a trace, then immediately activate place a via without moving mouse and click again, you do not switch layers. (presumably because the router mode stops at this point so there’s no change of continuing on another layer)

I just checked in rc3++, v + shift click / double click will drop you back into the layer that you had selected in the appearance manager before you started routing.

  1. Choose F.Cu from appearance manager
  2. Start routing from something on f.cu
  3. Press V
  4. Double click
  5. Track ends, you’re back to F.Cu (visually and layer indicator in appearance manager)
  6. Click on via, you start routing on F.Cu

And vice versa for B.Cu.

I appreciate your help with this, shift-click appears to be the work-around I’m looking for (I missed it in your earlier message, sorry). Shift-click as a partial (but not exact) replacement for double-click is not mentioned in docs anywhere that I can find quickly though, perhaps it belongs as an extra line in Preferences > PCB Editor > Editing Options > Left Click Mouse Commands?

AFAICT shift click and double click are the same here?

I think this is routing/via specific, my first post was copying from the “placing vias” section under routing (which I wrote, so any errors are mine)

Edit: the tracks section should probably mention that shift click/double click end routing, though (I think they do, anyway, memory is fickle)

Ah, I see the shift-click mention in docs now! Didn’t look carefully enough.

I do still maintain shift- and double-click do different things though. The shift-click ends routing mode immediately, while double-clicking only sometimes ends routing mode immediately (apparently if the new route would be 0 length).

EDIT2: I take it back, double-click is special, but it appears to execute the single click action (if traces have been left floating) before the double-click action and that’s what’s confusing me I think.

I’ll have to check; I didn’t notice a difference when I was playing with it but I’ll look again.

I am reading the whole story and it is for me hard to imagine the problem and the proposed solutions and differences between them (my fault).
The reason is that even using KiCad since 2017 I have never placed even a single via using ‘V’ hotkey so I have never noticed a layer change during placing via.
It is because at my PCBs I have only GND vias and I place them by clicking “Add free-standing vias” in the right tool bar and then one click = one GND via (I have GND zone filled).
I write it only because you said:

and I don’t associate ground via with hotkey V.

1 Like

Years ago, version 4, I assigned B shortcut for End Track and N shortcut for Front Layer in order to do via stitching. This way it was easy with 3 fingers on the keyboard to place a via and come back to the front layer and avoid some mouse clicks.

1 Like