Input Deck Layout Detection

Is there a way to detect the layout of modules on the input deck? I’m fiddling with a pair of the LED matrix modules, and I want to be able to see where each one is connected (which one is on the left or the right, but also if they are mounted together or split on opposite sides of the keyboard).

Bonus points would be detecting which position (left/center/right) the touchpad and/or keyboard is in.

2 Likes

What OS?
You could check which usb port it’s connected to. You’d have to map out which spot corresponds to which number port on the midplate hub first.

1 Like

I was thinking about sussing out the same info. In particular, for the LED matrix service that puts system stats on the panels. It only works if the modules are in far left/right slots with keyboard in center. I’d love to put in a pull req to add detection for other positions (both on left or right, for example).

It does seem that the port paths do remain static, at least in Linux’s case. That’s how the sys stat service currently addresses them, and it works across several distros.

As well as modules, I use multiple input covers. It would be ideal if the BIOS could detect these prior to boot and load them prior to OS start rather than manually changing the input language.

You sometimes swap between different language FWL16 keyboards?

With the current keyboard hardware and firmware I don’t believe there is a way for the BIOS, or the OS for that matter, to tell the language of any ISO layout keyboard. All ISO layout keyboards seem identical as far as hardware and firmware. The only thing that makes each different is the keycap letter legends, nothing else.

Framework could make a change to do it. But actually anyone could do it as well, at least for OS-level keyboard language detection. Just change the keyboard’s USB product name to include a language identifier. The FWL16 keyboards run open source QMK firmware. Anyone can change it. Then you’d add a script that runs at boot, checks the keyboard product name, and changes OS language to match. The Raspberry Pi USB keyboards declare their language like this: Automatic USB keyboard language detection · GitHub.

All of the current FWL16 keyboards

USB [VendorID]:[ProductID] “[Manufacturer][Product name]”
32ac:0012 “Framework Laptop 16 Keyboard Module - ANSI”
32ac:0013 “Framework Laptop 16 RGB Macropad”
32ac:0014 “Framework Laptop 16 Numpad Module”
32ac:0018 “Framework Laptop 16 Keyboard Module - ISO”
32ac:0019 “Framework Laptop 16 Keyboard Module - JIS”

The product name is defined in /keyboards/framework/iso/info.json in the QMK firmware. "keyboard_name": "Laptop 16 Keyboard Module - ISO",

An example of detecting the Raspberry Pi USB keyboard’s declared language and setting system language in Python for FreeBSD: ISO/overlays/uzip/localize/files/usr/local/sbin/localize at experimental · helloSystem/ISO · GitHub