It needs different firmware from the factory, so we need to distinguish
it from software in order to be able to update it correctly.
Signed-off-by: Daniel Schaefer <dhs@frame.work>
Let the keyboard figure out by itself whether the system is asleep by
looking at the USB connection state.
| | USB Active | USB Suspend |
| Lid Open | LED, keys | No LED, keys |
| Lid closed | No LED, no keys | No LED, no keys |
=> lid_open => keys registered
=> lid_open && !suspended => LEDs on
After waking from sleep, backlight does not turn back on.
Remove the custom backlight/sleep logic. Don't try to outsmart the core
quantum logic, let it handle the hard stuff. Our code just
suspends/wakes the keyboard.
Signed-off-by: Daniel Schaefer <dhs@frame.work>
If using VIA the backlight was set to effect 0, the only way to turn it
back on is using VIA or the RGB toggle key. But the user would expect
the next/prev animation key to also work.
Signed-off-by: Daniel Schaefer <dhs@frame.work>
With selective suspend windows likes to suspend the keyboard very
eagerly after 5 seconds without activity. So we send keyboard reports
every second for 25 seconds to keep it awake.
Signed-off-by: Daniel Schaefer <dhs@frame.work>
Factory mode enables layer 2 which has a regular keycode mapped to every
key. This way the factory can easily test whether the keys are working
or not.
It can either be disabled again or it'll turn of itself when the
keyboard resets.
Signed-off-by: Daniel Schaefer <dhs@frame.work>
If the backlight brightness was changed and the keyboard unplugged and
replugged, the lights would stay off. They should come back to the
previous value, which will happen automatically but the code would
override.
Signed-off-by: Daniel Schaefer <dhs@frame.work>
When enabled, overrides whatever keyboard layout and always makes the
keys in the physical location of F2, F10 and F12 send the keycodes for
F2/F10/F12.
BIOS is supposed to enable this right after USB enumeration, so that the
BIOS hot keys always work, even if FN-lock is enabled or the user has
remapped their keyboard.
BIOS mode is exited either by the keyboard resetting or by sending the
disable message.
How to send:
1. Find USB devices with Framework VID 0x32AC
2. Filter by interface number == 0x01 and usage page == 0xFF60
3. Set HID report with the following body:
Enable: 0x00 0x0B 0x05 0x01 0xFE 0xFE ... pad the 32 byte buffer with 0xFE
Disable: 0x00 0x0B 0x05 0x00 0xFE 0xFE ... pad the 32 byte buffer with 0xFE
Where the first byte is the report ID 0x00
TODO:
- [ ] Test on ANSI keyboard
- [x] Test on ISO keyboard
- [ ] Test on JIS keyboard
- [ ] Add method to get current status
Signed-off-by: Daniel Schaefer <dhs@frame.work>