Keyboard: VIA / VIAL support?

What does the Vial app say for About > About [device]?

Depends on how bad you bork it.
There is a reset function in qmk bootmagic

Bootmagic reset: Hold down the key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard

There are also a few other ways to get into bootloader mode, most rely on the firmware to be somewhat working.

The last resort is the RP2040 BOOTSEL pin. But you’ll need a way to connect the module while pressing or shorting BOOTSEL. Input Module Developer Program
Now, I don’t actually know if Framework broke the BOOTSEL pin out, either to a small button or a pad. I don’t have a macropad and the image on framework’s site doesn’t show. It could be hidden under the stickers. Maybe you could check and let us know?


I want to say that Framework must have broke it out to a pad at least. But if they somehow failed to do so, the real last resort is using a needle to short the BOOTSEL pin on the chip itself.

With the firmware I flashed…
keyboard.frame.work
20:59:16.104

  • Fetching v2 definition failed

  • Device: Laptop 16 RGB Macropad

  • Vid: 0x32AC

  • Pid: 0x0013

With the vial side load…
Manufacturer: Framework

Product: Laptop 16 RGB Macropad

VID: 32AC

PID: 0013

Device: b’\\?\hid#vid_32ac&pid_0013&mi_01#9&262db93d&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}’

Sideloaded JSON, Vial functionality is disabled

VIA protocol: 9

Vial protocol: -1

Vial keyboard ID: -0000001

Macro entries: 16

Macro memory: 14707 bytes

Macro delays: unsupported - sideloaded keyboard

Complex (2-byte) macro keycodes: unsupported - sideloaded keyboard

Tap Dance entries: unsupported - sideloaded keyboard

Combo entries: unsupported - sideloaded keyboard

Key Override entries: unsupported - sideloaded keyboard

QMK Settings: unsupported - sideloaded keyboard

Do you have your code on a github repository?

1 Like

Edit: I reread again and see that this hasn’t been successful yet. I am definitely following along now. Wanted to add this edit to save confusion.

As someone with no knowledge of how to mess with via/vial/etc

If someone has a github repo and or a guide that would be awesome. I am gonna try and re read this thread again to see if I can follow it :slight_smile: But if anyone puts up a guide, you will be a hero.

What are you looking to do?
For Vial there is no guide because no one has ported over Framework’s changes to make working Vial firmware. Hopefully Allen_S gets it working.

For Via/qmk, if you want something that you can’t do in the Via GUI, I did make a little guide on compiling firmware. Custom QMK firmware? - #14 by MJ1

Hey MJ1,

thanks for the reply - I actually re-read and saw that Allen is basically pathfinding this for us - I thought I read he got it working. I see he is still testing. My bad on mis-reading (why I deleted my post actually - wanted to prevent confusion).

Ill check out your guide. I would like to see some better RGB options - not sure if VIAL provides any? And also better linux support as always.

I was going to try and get it working before an upload or a fork…
I spent the last hour reading thru all custom work that framework did to the driver. (I should have written it down… to enumerate here since I just spent the time doing it.)

Some Sleep tweaks, usb driver updates to account for using the keyboard in the bios, if OS is bios, force ''normal keys" so you can’t screw up too badly, Serial Number stuff, airplane mode key, etc. Some debug…

Since I’m only messing with the macropad, not the main keyboard bios, I’m tempted to ignore 99% of the changes, and try and use the macropad vanilla with vial with the make files…

I’m going to mess with it more. If I get anywhere, I’ll upload FOR SURE, but the process I followed was pretty straight forward. (The Merges weren’t bad, and only minor changes to the framework files (RGB lowercases is all)) Then just adding the ‘standard vial’ stuff where it says to add it.

3 Likes

Sorry, I missed that you deleted it. I must have started writing my reply before that.

What kind of RGB options? We don’t have anything like per-key RGB control through a GUI yet. You have to do it directly in qmk.

Linux support, I feel like it’s the same as windows? Except for having to fix browser permissions for Via to connect in some distros. I use qmk, Vial, and Via on linux.

No one hold your breath I’m going to figure it out… I code python 99% of the time, and I’m self taught 100% But I had a few hours to burn, and I’m not scared to try things, so I started to hack on it.

Fortunately most code looks the same, so it’s not too hard to get the gist of what code does.

I should have started with just the macropad to begin with, start small, expand as needed.

1 Like

To be honest, I’d do that. If nothing else, just to see it working. And sort of as a simple starting point.

Got it… Macropad with vial…

So their serial number override had to go, but the rest stayed…

Manufacturer: Framework

Product: Laptop 16 RGB Macropad

VID: 32AC

PID: 0013

Device: b’\\?\hid#vid_32ac&pid_0013&mi_01#9&317d76af&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}’

VIA protocol: 9

Vial protocol: 6

Vial keyboard ID: 400005A587A37FD

Macro entries: 16

Macro memory: 14707 bytes

Macro delays: yes

Complex (2-byte) macro keycodes: yes

Tap Dance entries: 32

Combo entries: 32

Key Override entries: 32

QMK Settings: yes

3 Likes

https://imgur.com/a/QERPj6A
vial shot working.

4 Likes

Great to see this work being done!

I guess the next major milestone would be to successfully port onto a keyboard module, after which it should be fairly easy to account for the differences in layouts (ANSI, ISO etc)

I put a copy of the firmware I was able to use in the github repo under the release, so if anyone wants to risk it. You can see the code, nothing particularly exciting was changed, just remove the features not in the base repo, and create keyboard data for the macropad.

macropad vial firmware

I believe I found a single typo, surprised it’s compiling, I guess it states clearly framework doesn’t use this code. But it’s broke!

Unmatched braces…{ … }

I went thru all the code again, meticulously applied all the framework changes to vial. The only change I had to skip was the serial number to get a compile, and now the macropad works with the merge of vial + frameworks changes (except to the serial number).

MJ1 did I see a json for the ansi keyboard on here?

I’m going to attempt to flash my ansi keyboard and see if the airplane mode button still works. I’m less concerned with the UEFI/BOS changes, but I could test them by remapping keys, going into the BIOS and confirming that they keys are back to “normal” while in the BIOS.

Well it works, I just don’t seem to have lighting control…

But hey a gui for tapdance!!! I’m in! That was my number 1 desire!

I’ll post it in the same repo as the other.

I rebound the airplane mode key in vial, and it works. So I’m not sure what was up with they key code in the config I copied from framework, but it does work!!!

2 Likes

Yep, here is my ansi vial .json

/keyboards/framework/ansi/keymaps/vial/vial.json

{
  "name": "Framework Laptop 16 Keyboard - ANSI",
  "vendorId": "0x32AC",
  "productId": "0x0012",
  "customKeycodes": [
	{"name": "FN_LOCK",
	 "title": "Toggles Fn Lock.  FN_LOCK",
	 "shortName": "fn lock"
	},
	{"name": "KC_SCRN",
	 "title": "Simulates WIN+P, which toggles video source.  KC_SCRN",
	 "shortName": "Display"
	},
	{"name": "KC_AIRP",
	 "title": "Toggles Airplane Mode.  KC_AIRP",
	 "shortName": "Airp"
	}
],
  "lighting": "vialrgb",
  "matrix": {
    "rows": 8,
    "cols": 16
  },
  "layouts": {
    "keymap": [
  [
    {
      "w": 1.25,
      "h": 0.5
    },
    "7,5",
    {
      "x": 0.25,
      "h": 0.5
    },
    "3,5",
    {
      "x": 0.25,
      "h": 0.5
    },
    "2,5",
    {
      "x": 0.25,
      "h": 0.5
    },
    "6,4",
    {
      "x": 0.25,
      "h": 0.5
    },
    "3,4",
    {
      "x": 0.25,
      "h": 0.5
    },
    "4,10",
    {
      "x": 0.25,
      "h": 0.5
    },
    "3,10",
    {
      "x": 0.25,
      "h": 0.5
    },
    "2,10",
    {
      "x": 0.25,
      "h": 0.5
    },
    "1,15",
    {
      "x": 0.25,
      "h": 0.5
    },
    "3,11",
    {
      "x": 0.25,
      "h": 0.5
    },
    "4,8",
    {
      "x": 0.25,
      "h": 0.5
    },
    "6,8",
    {
      "x": 0.25,
      "h": 0.5
    },
    "3,15",
    {
      "x": 0.25,
      "w": 1.75,
      "h": 0.5
    },
    "0,1"
  ],
  [
    {
      "y": -0.25
    },
    "4,2",
    {
      "x": 0.25
    },
    "5,2",
    {
      "x": 0.25
    },
    "5,5",
    {
      "x": 0.25
    },
    "5,4",
    {
      "x": 0.25
    },
    "5,6",
    {
      "x": 0.25
    },
    "4,6",
    {
      "x": 0.25
    },
    "4,7",
    {
      "x": 0.25
    },
    "5,7",
    {
      "x": 0.25
    },
    "5,10",
    {
      "x": 0.25
    },
    "5,8",
    {
      "x": 0.25
    },
    "4,13",
    {
      "x": 0.25
    },
    "2,13",
    {
      "x": 0.25
    },
    "4,14",
    {
      "x": 0.25,
      "w": 2
    },
    "5,14"
  ],
  [
    {
      "y": 0.25,
      "w": 1.5
    },
    "3,2",
    {
      "x": 0.25
    },
    "0,2",
    {
      "x": 0.25
    },
    "6,5",
    {
      "x": 0.25
    },
    "2,4",
    {
      "x": 0.25
    },
    "6,6",
    {
      "x": 0.25
    },
    "3,6",
    {
      "x": 0.25
    },
    "3,7",
    {
      "x": 0.25
    },
    "6,7",
    {
      "x": 0.25
    },
    "6,10",
    {
      "x": 0.25
    },
    "3,8",
    {
      "x": 0.25
    },
    "5,13",
    {
      "x": 0.25
    },
    "6,13",
    {
      "x": 0.25
    },
    "6,14",
    {
      "x": 0.25,
      "w": 1.5
    },
    "2,8"
  ],
  [
    {
      "y": 0.25,
      "w": 1.75
    },
    "4,4",
    {
      "x": 0.25
    },
    "7,2",
    {
      "x": 0.25
    },
    "4,5",
    {
      "x": 0.25
    },
    "7,14",
    {
      "x": 0.25
    },
    "7,6",
    {
      "x": 0.25
    },
    "2,6",
    {
      "x": 0.25
    },
    "2,7",
    {
      "x": 0.25
    },
    "7,7",
    {
      "x": 0.25
    },
    "7,10",
    {
      "x": 0.25
    },
    "7,8",
    {
      "x": 0.25
    },
    "7,13",
    {
      "x": 0.25
    },
    "0,14",
    {
      "x": 0.25,
      "w": 2.5
    },
    "1,14"
  ],
  [
    {
      "y": 0.25,
      "w": 2.5
    },
    "1,9",
    {
      "x": 0.25
    },
    "1,5",
    {
      "x": 0.25
    },
    "0,5",
    {
      "x": 0.25
    },
    "0,0",
    {
      "x": 0.25
    },
    "0,6",
    {
      "x": 0.25
    },
    "1,6",
    {
      "x": 0.25
    },
    "1,7",
    {
      "x": 0.25
    },
    "0,7",
    {
      "x": 0.25
    },
    "0,10",
    {
      "x": 0.25
    },
    "0,8",
    {
      "x": 0.25
    },
    "0,13",
    {
      "x": 0.25,
      "w": 3
    },
    "0,9"
  ],
  [
    {
      "y": 0.25,
      "w": 1.25
    },
    "1,12",
    {
      "x": 0.25
    },
    "2,2",
    {
      "x": 0.25
    },
    "3,1",
    {
      "x": 0.25
    },
    "1,3",
    {
      "x": 0.25,
      "w": 6
    },
    "1,4",
    {
      "x": 0.25
    },
    "0,3",
    {
      "x": 0.25
    },
    "0,12",
    {
      "x": 0.25,
      "w": 1.25
    },
    "6,11",
    {
      "x": 0.25,
      "w": 1.25,
      "h": 0.5
    },
    "1,13",
    {
      "x": 0.25,
      "w": 1.25
    },
    "2,15"
  ],
  [
    {
      "y": -0.5,
      "x": 15.5,
      "w": 1.25,
      "h": 0.5
    },
    "1,8"
  ]
]
  }
}

For the customKeycodes to work in Vial, it would need them defined in the keymap the way Vial requires. I could do that in a little bit.

~edit~

Opps, I replied before reading your whole post. Guess you don’t need the vial .json? Did you get customKeycodes to work and display their names properly in Vial?

Anyway, here is a ansi keymap with Vial custom keycodes the way it wants them.

/keyboards/framework/ansi/keymaps/vial/keymap.c

// SPDX-License-Identifier: GPL-2.0-or-later

#include QMK_KEYBOARD_H
#include "framework.h"

enum custom_keycodes {
    FN_LOCK = QK_KB_0,
    KC_SCRN,
    KC_AIRP,
};

enum _layers {
  _BASE,
  _FN,
  _FN_LOCK,
  _FM
};


const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
     /*
     *         ┌─────┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬────┐
     * 14 keys │ESC  │Mut│vDn│vUp│Prv│Ply│Nxt│bDn│bUp│Scn│Air│Prt│App│Del │
     *         ├───┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┤
     * 14 keys │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │Backsp│
     *         ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬────┤
     * 14 keys │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \  │
     *         ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴────┤
     * 13 keys │ Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ Enter │
     *         ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───────┤
     * 12 keys │ Shift  │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │  Shift  │
     *         ├────┬───┼───┼───┼───┴───┴───┴───┴───┼───┼───┼───┴┬───┬────┤
     *         │    │   │   │   │                   │   │   │    │↑  │    │
     * 11 keys │Ctrl│FN │GUI│Alt│                   │Alt│Ctl│ ←  ├───┤  → │
     *         │    │   │   │   │                   │   │   │    │  ↓│    │
     *         └────┴───┴───┴───┴───────────────────┴───┴───┴────┴───┴────┘
     * 78 total
     */
    [_BASE] = LAYOUT(
        KC_ESC,  KC_MUTE, KC_VOLD, KC_VOLU, KC_MPRV, KC_MPLY, KC_MNXT, KC_BRID, KC_BRIU, KC_SCRN, KC_AIRP, KC_PSCR, KC_MSEL, KC_DEL,
        KC_GRV,  KC_1,    KC_2,    KC_3,    KC_4,    KC_5,    KC_6,    KC_7,    KC_8,    KC_9,    KC_0,    KC_MINS, KC_EQL,  KC_BSPC,
        KC_TAB,  KC_Q,    KC_W,    KC_E,    KC_R,    KC_T,    KC_Y,    KC_U,    KC_I,    KC_O,    KC_P,    KC_LBRC, KC_RBRC, KC_BSLS,
        KC_CAPS, KC_A,    KC_S,    KC_D,    KC_F,    KC_G,    KC_H,    KC_J,    KC_K,    KC_L,    KC_SCLN, KC_QUOT,          KC_ENT,
        KC_LSFT,          KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,    KC_N,    KC_M,    KC_COMM, KC_DOT,  KC_SLSH,          KC_RSFT,
        KC_LCTL, MO(_FN), KC_LGUI, KC_LALT,          KC_SPC,                    KC_RALT, KC_RCTL, KC_LEFT,   KC_UP, KC_DOWN, KC_RGHT
    ),
     /*
     * Function layer
     *         ┌─────┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬────┐
     * 14 keys │FN lk│F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│Ins │
     *         ├───┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┤
     * 14 keys │   │   │   │   │   │   │   │   │   │   │   │   │   │      │
     *         ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬────┤
     * 14 keys │     │   │RGB│Nxt│Hue│Sat│Spd│Brt│   │   │Pau│   │   │    │
     *         ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴────┤
     * 13 keys │      │   │SRq│Prv│Hue│Sat│Spd│Brt│ScL│   │   │   │       │
     *         ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───────┤
     * 12 keys │        │   │   │   │   │   │Brk│   │   │   │   │         │
     *         ├────┬───┼───┼───┼───┴───┴───┴───┴───┼───┼───┼───┴┬───┬────┤
     *         │    │   │   │   │                   │   │   │    │PgU│    │
     * 11 keys │    │   │   │   │ Toggle Backlight  │   │   │Home├───┤End │
     *         │    │   │   │   │                   │   │   │    │PgD│    │
     *         └────┴───┴───┴───┴───────────────────┴───┴───┴────┴───┴────┘
     * 78 total
     */
    [_FN] = LAYOUT(
        FN_LOCK, KC_F1,   KC_F2,   KC_F3,   KC_F4,   KC_F5,   KC_F6,   KC_F7,   KC_F8,   KC_F9,   KC_F10,  KC_F11,  KC_F12,  KC_INS,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_SPI, RGB_VAI, _______, _______, KC_PAUS, _______, _______, _______,
        _______, _______, KC_SYRQ, RGB_RMOD,RGB_HUD, RGB_SAD, RGB_SPD, RGB_VAD, KC_SCRL, _______, _______, _______,          _______,
        _______,          _______, _______, BL_BRTG, _______, KC_BRK,  _______, _______, _______, _______, _______,          _______,
        _______, _______, _______, _______,          BL_STEP,                   _______, _______, KC_HOME, KC_PGUP, KC_PGDN, KC_END
    ),
    // Function lock layer
    // Everything on F-row locked to function layer, except ESC and DEL
    [_FN_LOCK] = LAYOUT(
        _______, KC_F1,   KC_F2,   KC_F3,   KC_F4,   KC_F5,   KC_F6,   KC_F7,   KC_F8,   KC_F9,   KC_F10,  KC_F11,  KC_F12,  _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,          _______,
        _______,          _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,          _______,
        _______, MO(_FM), _______, _______,          _______,                   _______, _______, _______, _______, _______, _______
    ),
    // Locked+temporary FN (back to base plus extra keys)
    [_FM] = LAYOUT(
        FN_LOCK, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPRV, KC_MPLY, KC_MNXT, KC_BRID, KC_BRIU, KC_SCRN, KC_AIRP, KC_PSCR, KC_MSEL,  KC_INS,
        _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
        _______, _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_SPI, RGB_VAI, _______, _______, KC_PAUS, _______, _______, _______,
        _______, _______, KC_SYRQ, RGB_RMOD,RGB_HUD, RGB_SAD, RGB_SPD, RGB_VAD, KC_SCRL, _______, _______, _______,          _______,
        _______,          _______, _______, BL_BRTG, _______, KC_BRK,  _______, _______, _______, _______, _______,          _______,
        _______, _______, _______, _______,          BL_STEP,                   _______, _______, KC_HOME, KC_PGUP, KC_PGDN, KC_END
    ),
};

// Custom keycode handling
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
    switch (keycode) {

        // Make sure to keep FN Lock even after reset
        case FN_LOCK:
            if (record->event.pressed) {
                if (layer_state_is(_FN)) {
                    set_single_persistent_default_layer(_FN_LOCK);
                }
                if (layer_state_is(_FM)) {
                    set_single_persistent_default_layer(_BASE);
                }
            }
            return false;
            break;

        default:
            break;
    }
    return true;
}

Just saw that you have ansi on your github. I didn’t have lighting defined in the ansi .json which I posted in the other thread. But it’s set in the ansi .json above.

Well it seems to work fine, I can still use the RGB+ go go thru the various settings. I’ll have to do more research to figure out why VIA / Framework site doesn’t work, and only the stand alone does…

I’m not sure if you saw, but my ‘release’ has the binary for both macro-pad and the ansi keyboard.

2 Likes