2026 BFCM is Live! Save Up to 40% Plus $30 OFF $300+

Shop US in-stock products - no surprise tariffs, and free shipping $69+

VIA Keyboard Layers and Macros: Step-by-Step Setup with Tap-Hold Keys

Published: November 26, 2026 · 9 min read

VIA Keyboard Layers and Macros: Step-by-Step Setup with Tap-Hold Keys

You opened VIA to put a number pad under your right hand or to turn your email sign-off into one key, and the Configure tab showed four layers and a long list of codes. Most of what you need sits in three places: the Layers menu, the Macros tab, and one button called Any.

One thing up front. On a Keychron Q6 Max, Q1 Max, or K3 Max, edit Layer 0 and Layer 1 if the Mac/Windows switch is on Mac, and Layer 2 and Layer 3 if it is on Windows. If a change seems to do nothing, check that you edited the pair your switch uses.

Key takeaways

  • Pick the right layer pair: on these three boards, Layer 0 and Layer 1 serve the Mac side of the switch, and Layer 2 and Layer 3 serve the Windows side.
  • MO for holding, TG for staying: MO(n) turns a layer on while you hold the key, and TG(n) switches it on until you press the key again.
  • Macros take two steps: write the macro in the Macros tab and save it, then put M0 to M15 on a key from the Macro menu.
  • Tap-hold lives in Any: type MT(MOD_LCTL,KC_ESC) for Esc on a tap and Ctrl on a hold, or LT(n,key) for a key that opens a layer while held.

Quick setup: VIA layers and macros in five steps

The short version: connect, pick the layer, assign, save the macro, and test.

  1. Connect the keyboard with a USB cable and open usevia.app in Chrome, Edge, or Opera. Click Authorize device, then select your keyboard.
  2. In Configure, choose the layer number at the top left that matches your Mac/Windows switch.
  3. Click a key on the picture, then click its new function in the menu below. VIA writes the change to the keyboard as soon as you pick it.
  4. For a macro, open Macros on the left, type it into M0, and click Save. Then go back to Keymap, click a key, and pick M0 from Macro.
  5. Try it in a text editor. Hold your layer key and press the keys you changed.

Connect your Keychron keyboard to VIA

Use the cable and a browser with WebHID. VIA talks to the keyboard through WebHID, which Chrome, Edge, and Opera support. Firefox and Safari do not.

Put the keyboard in wired mode and plug in the USB cable. Your manual shows where the mode switch is. After Authorize device, the browser lists your keyboard. Select it and click Connect.

Some boards need one more step. If VIA says it could not find a definition for your keyboard, as it may for the Q6 Max, load the keyboard's JSON file in the Design tab. The steps are in the fixes section below.

Keychron Launcher, our own web app, edits the same keymap and also updates firmware. Our QMK vs VIA vs Launcher guide explains how the two relate.

How VIA layers work on a Keychron keyboard

A layer is a full second keymap that sits on top of the first. When a higher layer is on, its keys win. Where a key on that layer is transparent, the press falls through to the layer underneath.

VIA shows four layers on the Q6 Max, Q1 Max, and K3 Max, numbered 0 to 3. Keychron's firmware splits them by system:

  • Layer 0: the Mac base layer, which you type on with the switch on Mac.
  • Layer 1: the Mac Fn layer. The Fn key on Layer 0 is MO(1).
  • Layer 2: the Windows base layer, active with the switch on Windows.
  • Layer 3: the Windows Fn layer. The Fn key on Layer 2 is MO(3).

Diagram of the four VIA layers on the Keychron Q6 Max, Q1 Max, and K3 Max: the switch on Mac uses Layer 0 with an MO(1) Fn key to Layer 1, the switch on Windows uses Layer 2 with an MO(3) Fn key to Layer 3

An illustration drawn for this guide. The layer numbers come from the Keychron QMK keymaps for these three boards.

That split is how the Q6 Max saves two layouts, one for each system. It also explains a common surprise. QMK reads the active layers from the top down, so a lower layer only shows through where your base layer key is ▽. With the switch on Windows, your base is Layer 2, which has almost no ▽ keys, so an MO(1) key appears to do nothing. On the Windows side, point layer keys at Layer 3.

Two keys in the Basic menu control what falls through. The ▽ key is transparent, which VIA calls Pass-through. The blank key is KC_NO, which VIA calls Nothing, so the key sends nothing at all.

Layer keys compared: MO, TG, TT, OSL, TO, and LT

For most setups, MO is the one to start with. It behaves like the Fn key you already use. The Layers menu lists each type for layers 0 to 9, so pick a number from 0 to 3 on these boards.

VIA Configure tab for a Keychron Q6 Max ANSI Knob with Layer 1 selected, showing F1 to F12, Bluetooth host keys, 2.4G, RGB lighting keys, and transparent keys, with the Layers menu open below

Layer key What it does Back to the base layer Pick it if
MO(n) Turns layer n on while you hold the key When you let go you want an Fn-style key
TG(n) Switches layer n on or off with each press When you press it again you want a layer to stay on, such as a number pad
TT(n) Works like MO when held, toggles when tapped several times When you let go, or after more taps you want both on one key
OSL(n) Turns layer n on for the next key press only After one key press you want one symbol without holding a key
TO(n) Turns layer n on and every other layer off, except the base When another layer key moves you you want a fixed jump to one layer
LT(n,key) Turns layer n on while held, sends the key when tapped When you let go you want Space or Caps Lock to double as a layer key

DF(n), also in the menu, changes the base layer until the keyboard loses power. The Mac/Windows switch already does that job here, so leave DF alone.

A number pad layer for the Q1 Max or K3 Max, which have no number pad. On Layer 1 (or Layer 3 on Windows), set M, comma, and period to 1, 2, and 3, and J, K, and L to 4, 5, and 6. Fn sits in the bottom row, right of the space bar, so for a few digits hold Fn and type the numbers. For longer runs of numbers, put TG(1) or TG(3) on a spare key of your base layer and tap it once to switch the layer on. Leave that same key as ▽ on the number layer, so the next press switches the layer back off. Keys you leave as ▽ keep working as usual.

How to create a macro in VIA and assign it to a key

Write the macro first, then give it a key. The firmware on these boards has 16 macro slots, M0 to M15.

  1. Click Macros in the left column and select M0.
  2. Pick the script view, the code icon above the editor, and type your text. Wrap keys in curly brackets, for example {KC_ENT} for Enter.
  3. Click Save.
  4. Go back to Keymap, choose the layer, click the key that should play the macro, and pick M0 from the Macro menu.

VIA Macros tab for a Keychron Q6 Max ANSI Knob with M0 selected in script view, the text Best regards followed by the Enter keycode, and the script help lines with a Save button

The help lines under the editor show the rest of the syntax. A chord such as {KC_LCTL, KC_C} presses keys together, and {+KC_LSFT} and {-KC_LSFT} hold and release a key. The other view records what you type, and VIA only records with the window in fullscreen.

All macros share one memory space, shown by the bar above the editor. Put macros on Layer 1 or Layer 3 to keep the base layer as it is.

Tap-hold keys with VIA's Any key

Tap-hold keys go in through Any. It sits at the end of the Special menu and accepts a QMK keycode you type in.

To make Caps Lock send Esc on a tap and Ctrl on a hold:

  1. Choose your base layer and click Caps Lock on the keyboard picture.
  2. Open Special, scroll to the end, and click Any.
  3. Type MT(MOD_LCTL,KC_ESC) and click Confirm.

VIA Configure tab for a Keychron Q6 Max ANSI Knob with the Any key dialog open over the keymap and MT(MOD_LCTL,KC_ESC) typed into the QMK keycode field, with Cancel and Confirm buttons

MT(mod,key) acts like a modifier while held and sends the key when tapped. LT(layer,key) does the same with a layer. LT(3,KC_SPC) types a space on a tap and opens Layer 3 while you hold it. The Layers menu also has ready-made Space Fn keys: use Space Fn1 with the switch on Mac and Space Fn3 with it on Windows.

Keep the tapped key simple. In QMK, the key inside LT() has to be a basic key such as a letter, Space, or Esc. A shifted symbol such as an exclamation mark will not fit there.

If you would rather click than type codes, Launcher's Keymap has a Hold / Tap tab on boards and firmware that show it. Our Launcher macro guide covers its recorder.

Fixes for when VIA does not find your keyboard or a layer key does nothing

Check the connection first, then the definition file, then the layer number.

  • The keyboard is not in the list: switch to Chrome, Edge, or Opera, use the cable, and unplug and replug the keyboard.
  • VIA could not find a definition: download the JSON file for your model, turn on Show Design tab in Settings, open Design, click Confirm, and drag the file in. Then click your keyboard model and Connect. The K3 Max file is on our firmware and JSON page. For the Q6 Max and Q1 Max, open the board's via_json folder in our QMK code on GitHub.
  • A change or layer key does nothing: check the Mac/Windows switch, and on Windows point layer keys at Layer 3.
  • You want a backup: open Save + Load and click Save Current Layout to keep a copy of your keymap on your computer.

Frequently asked questions

How many layers can you have in VIA?

On the Keychron Q6 Max, Q1 Max, and K3 Max, VIA shows four layers, Layer 0 to Layer 3. Two serve the Mac position, and two serve the Windows position.

What is the difference between MO and TG in VIA?

MO(n) keeps the layer on only while you hold the key. TG(n) turns the layer on with one press and off with the next.

Do VIA layers and macros stay saved when I switch computers?

Yes. VIA stores the keymap and macros in the keyboard's memory, so they travel with the keyboard. Use Save Current Layout if you also want a file copy.

TAGSHow-To

References & Citations

Browse Keychron custom keyboards →·Browse the Keychron blog →

WRITTEN BY

Carolyn · Editor-in-Chief, Keychron

Carolyn is the editor-in-chief of the Keychron blog and a keyboard and mouse enthusiast like you. She writes from a user's perspective and focuses on what makes a difference in everyday use. She supports open-source projects and believes that sharing knowledge helps the whole industry move forward. Her goal with every guide is simple: help fellow users find the gear that works for them.