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>
the tmk_core chibios protocol_pre_task does not
process any usb events when the host is in suspend.
I think there is a race condition where the usb_event_queue_task
will not be processed depending on when usb goes to sleep.
so we may fall into the
while (USB_DRIVER.state == USB_SUSPENDED) {
which comes directly from the hardware interrupt.
and never process pending events in
usb_event_queue_task();
Signed-off-by: Kieran Levin <ktl@frame.work>
Doesn't work yet, on Windows, because Windows will make a special
control request if it sees this.
On Linux lsusb shows it like this:
```
Binary Object Store Descriptor:
bLength 5
bDescriptorType 15
wTotalLength 0x0048
bNumDeviceCaps 2
USB 2.0 Extension Device Capability:
bLength 7
bDescriptorType 16
bDevCapabilityType 2
bmAttributes 0x00000000
(Missing must-be-set LPM bit!)
Platform Device Capability:
bLength 28
bDescriptorType 16
bDevCapabilityType 5
bReserved 0
PlatformCapabilityUUID {d8dd60df-4589-4cc7-9cd2-659d9e648a9f}
CapabilityData[0] 0x00
CapabilityData[1] 0x00
CapabilityData[2] 0x03
CapabilityData[3] 0x06
CapabilityData[4] 0x48
CapabilityData[5] 0x00
CapabilityData[6] 0x01
CapabilityData[7] 0x00
```
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>
Other low power states should be handled perfectly fine by USB suspend,
since this is now fixed in chibios.
Signed-off-by: Daniel Schaefer <dhs@frame.work>
* Keychron V4 ANSI: rename LAYOUT_ansi_61 to LAYOUT_60_ansi
* Keychron V4 ANSI: enable Community Layout support
* Keychron V4 ISO: correct layout data
Move position [3, 1] up by 0.25u.
* Keychron V4 ISO: rename LAYOUT_iso_62 to LAYOUT_60_iso
* Keychron V4 ISO: enable Community Layout support