Numpad alt codes?

Hi everyone! As a developer, I use alt codes all the time to type characters quickly. Do alt codes (ALT+126 for “~” for example) work on the Framework 16 keyboard + numpad configuration?
Thanks in advance!

That’s an OS level thing, nothing to do with the hardware, so as long as you are using the same/similar OS you are used to… Yes, the alt codes you are used to will continue to function.

3 Likes

Thank you, such a relief.
This doubt was brought up on a reddit post, users were talking about alt codes not working across separate USB devices, and the keyboard and numpad are seen by Windows as 2 HID devices, hence the doubt.

Yeah, I think you might have some issues with it. A search shows that people have problems with disconnected numpads and alt codes pretty regularly.

Depending how ingrained the specific alt key is in your muscle memory, and if you’re comfortable customizing the firmware, you could probably find a good way to create a “hold down alt” key or key combo directly on the numpad.

2 Likes

I see you already saw this thread, but for others who may be interested, it appears the Alt codes do NOT work by default on Windows.

Premise: I’ll check out QMK layers.
I still would like to use the alt codes. Unfortunately I’ll have to wait until Batch 15 :cry:

Are you refering to use ALT + four numbers to get an extended character (like 0128 for a Euro symbol)?

Yes, it’s them.

2 Likes

I’ve done a little investigation into finding a way to set up a communication channel within the firmware between the keyboard and numpad. In my case, my primary goal would be to sync the backlights, but it should also be possible to cause the numpad to echo certain modifier keys (or more likely route all of its generated keycodes through the main keyboard to inherit its modifier state).

The best mechanism I’ve come up with so far (theory only) would be to use the OS synchronization of one or more keyboard status lights (Caps Lock, Num Lock, Scroll Lock, ?Kana?, ?Compose?, etc. ) to pass “messages” between the separate USB devices.

This isn’t exactly a “solved” problem, but there’s some work out there on it. My research on it was centered around the Ploopy Nano trackball, which doesn’t have any buttons. There’s an example of very basic communication with the scoll lock in the QMK repo. If you want to get more involved (particularly if you want the communication flow in both directions), there’s some code here that might be a good starting point.

The most basic way of doing it would seem to be to turn on scroll lock when the keyboard alt key is held down, and turn if off when released. The numpad firmware would just watch for scroll lock events to hold and release a virtual alt key. That would probably have the least lag, but it would rely on scroll lock not actually being used otherwise. Anything else requires “flashing” one of the keys (changing state twice in a row), which would add some lag.

Maybe here. Some replies suggest other setups to type the characters on MSWindows.
https://www.reddit.com/r/framework/comments/1aif095/framework_16_numpad_alt_codes/

Is there a way to implement a num-lock for a numeric overlay on the main keyboard? I’ve had laptops with a numlock key but no numberpad. With the numlock enabled, the keys are mapped so
7→7, 8→8, 9→9;
u→4, i→5, o→6;
j→1, k→2, l→3;
m→0, .→.
and a few others for arithmetic operators.

Sure!
May I introduce you, my friend, to QMK layers!

You actually already know layers. Shift or capslock is a type of layer. So is Fn and FnLock on laptops. You could put numpad keys on the Fn layer, or you could create a seperate layer. Either would be done point-and-click by going to https://keyboard.frame.work/ on your FW16 in Chrome or another Chromium-based browser (like Edge).

Here it is on the Fn layer. Of course, you can place the keys how ever you wish, or put it on a different layer. Note that for alt-code use you’ll want to use numpad numbers, not normal numbers, they are different. Select “Any” key (bottom right, in orange) then enter KC_P1, KC_P2, etc.

If there is anyone with the Numpad and the ANSI keyboard that wants to try a custom solution, with the caveat that it is completely untested (I don’t have my 16 yet, and I’m not even ordering a numpad right now), I’ve thrown together a quick “altsync” branch of the Framework QMK firmware here:

It uses numlock and capslock to communicate the state of the alt keys on the main keyboard. There may be timing issues, so I’ve turned on console logging which can be watched with the QMK toolbox.

If you want to try it out with pre-compiled firmware, you can get the two files here (link expires in 2 months). I could also generate it for other keyboard types if desired. That said, anyone who wants to try this should be comfortable with replacing the firmware, as I’m not even sure where to get the default firmware image or how to update it myself yet!

3 Likes

I dont know if you can edit the post to this degree, but maybe you should change this to a feature request and request they change the firmware that reads their input to instead treat them as one, it should be possible, and might even be doable by a user with qmk firmware, but that i wont know until i get mine in batch 6

Official Framework complied firmware is here Releases · FrameworkComputer/qmk_firmware · GitHub Looks like they even made little window’s .exe apps to do the flashing. I’m presuming so that people don’t have to manually put their keyboards into bootloader mode.

To get into bootloader mode manually (such as to flash Ionitor’s firmware) you have 3 options:

  • On Framework Laptop 16 Keyboard: Hold down left ALT and right ALT while
    installing the module
  • On Framework Laptop 16 Numpad: Hold down keys for 2 and 6 while installing the
    module
  • Bootmagic reset: Hold down the key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard
  • Keycode in layout: Press the key mapped to QK_BOOT if it is available

When you do this, your keyboard will appear as a flash drive. You just drag-and-drop the approprate .uf2 file over to it. For example, framework_ansi_default_v0.2.9.uf2 for the ANSI keyboard. The keyboard will start running with the new firmware automatically.

2 Likes

One thing to check… in the USB HID IF spec, a keypad key is distinct from a keyboard key. If the QMK firmware is sending keyboard keys to the host, it wouldn’t work even with an ALT key on the keypad.

I took a quick glance at the QMK repo in the firmware github, but it wasn’t immediately obvious to me what the config is… but it’s something that could be looked at.

It sends proper keypad numbers

    [_NUMLOCK] = LAYOUT(
        KC_ESC,  KC_CALC, KC_EQL,  KC_BSPC,
        KC_NUM,  KC_PSLS, KC_PAST, KC_PMNS,
        KC_P7,   KC_P8,   KC_P9,
        KC_P4,   KC_P5,   KC_P6,   KC_PPLS,
        KC_P1,   KC_P2,   KC_P3,
            KC_P0,        KC_PDOT, KC_PENT
    ),

KC_P# are codes for keypad numbers in QMK.

1 Like

Rats… so there’s also generic desktop page that has different usage IDs for keyboard (0x06) vs. keypad (0x07) collections… so the USB data would possibly need to specify that with the mapping collection. Possibly Windows only works across the different types if the one is a keypad collection?

Not familiar with QMK, but I notice that none of the descriptors in tmk_core/protocol/usb_descriptor.c will use HID_RI_USAGE(8, 0x07)… if that’s where the descriptor comes from, possibly hacking that file to use 0x07 instead of 0x06 for the numpad would do the trick?

I’m batch 8, so it’ll be a while before I can play with this stuff.

1 Like

This is actually quite upsetting to me. Probably about 50% of the reason for taking a 16 over a 13 for me was to get a numpad, and I absolutely take for granted that a numpad will perform alt codes which I use regularly. I will not be happy with any solution other than holding an actual keyboard alt key and entering numbers on the numpad. I hope one of you clever folks much more educated in this stuff finds a solution. I’m confident I can implement anything, but I have had very limited interactions with firmware.