Giter Club home page Giter Club logo

keyboardiohid's Introduction

Repository Archived

This repository is no longer the place where KeyboardioHID is developed. KeyboardioHID has moved inside https://github.com/keyboardio/Kaleidoscope.

You can find it at https://github.com/keyboardio/Kaleidoscope/tree/master/plugins/KeyboardioHID

Keyboardio USB HID Driver

Based on Nico Hood's HID-Project. Please don't contact Nico with issues in this library.

Supported HID devices:

  • Boot Keyboard
  • NKRO Keyboard (press up to 113 keys at the same time)
  • Mouse (5 buttons, move, vertical wheel, horizontal wheel)
  • Absolute Mouse
  • Consumer/Media Keys (4 keys for music player, web browser and more)
  • System Key (for PC standby/shutdown)
  • Gamepad (32 buttons, 4 16bit axis, 2 8bit axis, 2 D-Pads)

keyboardiohid's People

Contributors

algernon avatar bjc avatar donoregano avatar gedankenexperimenter avatar gitter-badger avatar nicohood avatar obra avatar per1234 avatar sjb avatar tiltowait avatar tlyu avatar wez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

keyboardiohid's Issues

The recent hWheel support breaks AbsoluteMouse

I noticed that with the recent change to support horizontal wheel, AbsoluteMouse broke, and stopped working on my Linux, with the following messages in dmesg:

When plugging the keyboard in:

[Wed Nov 29 09:59:17 2017] hid-generic 0003:1209:2301.00FE: ignoring exceeding usage max

Whenever pressing a mouse warp key:

[Wed Nov 29 09:59:21 2017] usb 3-14.4.2: input irq status -75 received

With the hWheel support backed out of KeyboardioHID, warp keys work again, and I don't get the initial warning from hid-generic either.

Protocol woes

We have a problem.

With the recent change to default BootKeyboard to boot protocol, Linux never sets it to report protocol, thus, the keyboard will not be NKRO, only 6KRO.

If we default to report protocol, then wakeup won't work, and certain BIOSes may end up not liking it, either.

We need to spend a bit more time on this, to figure out if there's anything at all we can do, to support BIOSes, NKRO and wakeup automatically, reliably, across all major operating systems. There are a couple of tricks we could try, so not everything is lost yet.

Need a way to default to boot protocol

Currently, KeyboardioHID follows the HID spec, and defaults to report protocol, with an option to go back to boot. We should have a way to default to boot, without having to detach/attach first.

Mouse report suppression isn't quite correct

When suppressing unnecessary HID reports in Mouse_::sendReport(), the report is aborted only if both the previous report and the current one are empty. Because of the way mouse reports work, this isn't quite the right comparison. Instead, it should check that the mouse button state hasn't changed, and that the rest of the report (movement & scrolling) is empty.

As it is, if the user holds down a mouse button key, but no movement keys, it could send repeated unnecessary reports because the report isn't entirely empty.

Furthermore, it really isn't necessary to store the whole previous report (or a static empty report) in RAM, as the only thing that needs checking is the previous buttons byte.

Inconsistency in HID usage

Multireport/Keyboard.cpp and MultiReport/Mouse.cpp use the HID class to sent their reports. SingleReport/SingleAbsoluteMouse.cpp and BootKeyboard/BootKeyboard.cpp send them directly.

It would be nice for all devices to use the HID class for the sake of consistency and as this makes it possible to observe all HID reports via a common callback of the HID class (as it is already possible for keyboard and mouse reports). The latter is important for keyboard simulation and especially for simulation based integration testing where the generated HID reports and their precise timing are a major evaluation criterion.

Size reduction

There are a number of things in KeyboardioHID which are not used by neither the core firmware, nor any plugin, and which would be better implemented as an optional plugin.

Such things are Keyboard.write and the whole asciimap - removing these would save us many bytes. There may be other similar things, which make sense if one wants to be a replacement for the Arduino HID library, but otherwise, they don't.

I think it would be a good idea to go through the library, and remove the unnecessary parts, which could be implemented as Kaleidoscope plugins instead.

BootKeyboard's getIdle and getProtocol haven't been ported to anything other than SAMD or AVR

This breaks using the Keyboardio Model 100 in boot mode or if it's plugged into an intel mac before the mac is powered on.

cc @bjc

In theory, this patch should fix things, but it doesn't appear to:

modified: src/BootKeyboard/BootKeyboard.cpp
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
@@ -158,6 +158,8 @@ bool BootKeyboard_::setup(USBSetup& setup) {
 #ifdef ARDUINO_ARCH_SAM
       USBDevice.armSend(0, &protocol, 1);
 #endif
+      USB_SendControl(TRANSFER_RELEASE, &protocol, 1);
+// USB_Flush(0);
       return true;
     }
     if (request == HID_GET_IDLE) {
@@ -167,6 +169,10 @@ bool BootKeyboard_::setup(USBSetup& setup) {
 #endif
 #ifdef ARDUINO_ARCH_SAM
       USBDevice.armSend(0, &idle, 1);
+#endif
+#if ((!defined  ARDUINO_ARCH_SAM)  &&  (!defined __AVR__))
+      USB_SendControl(TRANSFER_RELEASE, &idle, 1);
+   USB_Flush(0);
 #endif
       return true;
     }

A better way to override the short name

There's a function in PluggableUSB called getShortName(), which is used to send a response to an ISERIAL descriptor request. We use this to send a device-specific name back, like kbio01, atreus, etc. The way we accomplish this overrideability is by marking HID_::getShortName() as a weak symbol, and overriding it with our custom function that calls Kaleidoscope.device().getShortName(). Thus, the linker will use our override for HID_::getShortName().

This has a number of downsides, including that of not being particularly clean, and requiring us to inject the override somewhere into the firmware, which we currently do by doing it as part of the KEYMAPS() macro - something completely unrelated.

So, I was thinking about what would be a better way to accomplish the same thing? One that doesn't require us to do a link-time function override, nor using an unrelated macro to accomplish the override.

I see two paths that might be worth exploring:

A shortName member variable

Using a member variable, and an appropriate setter has the benefit of being very flexible, and allows us to change the shortname at any time, during runtime. The downside of it is that with the shortname no longer being constant, this is slightly more code and data used. It's trivial to implement, though, and can be entirely backwards compatible.

Inheritance

Another option, which is considerably more complicated, would be to not initialize a HID object, but only ship the class in the library, and defer the instantiation to users of the library, such as Kaleidoscope. We could then update Kaleidoscope's driver::hid::KeyboardioHID to subclass KeyboardioHID, and override getShortName() there, at the c++ level, rather than at link time.

This has the advantage of the short name still being constant. The downside is that the library would no longer be a drop-in replacement for Arduino's HID, but slightly more Kaleidoscope-specific, and it breaks backwards compatibility, as users of the library will have to instantiate a HID object themselves. With our major user being Kaleidoscope, I believe that such a breakage is acceptable.

'class HID_' has no member named 'getLEDs'

Using Arduino IDE 1.8.5 (Windows store 1.8.10.0)
Arduino AVR Boards v 1.6.21 (tried 1.6.20, 1.6.19, 16.18)

Trying to compile KeyboardLed.ino from examples and get:

C:\Users\iLobster\Documents\Arduino\libraries\KeyboardioHID\src/MultiReport/Keyboard.h:62:36: error: 'class HID_' has no member named 'getLEDs'

--- full output:

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.10.0_x86__mdqgnx93n4wtt\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.10.0_x86__mdqgnx93n4wtt\hardware -hardware C:\Users\iLobster\Documents\ArduinoData\packages -hardware C:\Users\iLobster\Documents\Arduino\hardware -tools C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.10.0_x86__mdqgnx93n4wtt\tools-builder -tools C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.10.0_x86__mdqgnx93n4wtt\hardware\tools\avr -tools C:\Users\iLobster\Documents\ArduinoData\packages -built-in-libraries C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.10.0_x86__mdqgnx93n4wtt\libraries -libraries C:\Users\iLobster\Documents\Arduino\libraries -fqbn=HoodLoader2:avr:HoodLoader2atmega16u2:board=uno -ide-version=10805 -build-path C:\Users\iLobster\AppData\Local\Temp\arduino_build_535860 -warnings=none -build-cache C:\Users\iLobster\AppData\Local\Temp\arduino_cache_322616 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=C:\Users\iLobster\Documents\ArduinoData\packages\arduino\tools\avrdude\6.3.0-arduino9 -prefs=runtime.tools.arduinoOTA.path=C:\Users\iLobster\Documents\ArduinoData\packages\arduino\tools\arduinoOTA\1.1.1 -prefs=runtime.tools.avr-gcc.path=C:\Users\iLobster\Documents\ArduinoData\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2 -verbose C:\Users\iLobster\Documents\Arduino\libraries\KeyboardioHID\examples\Keyboard\KeyboardLed\KeyboardLed.ino
C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.10.0_x86__mdqgnx93n4wtt\arduino-builder -compile -logger=machine -hardware C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.10.0_x86__mdqgnx93n4wtt\hardware -hardware C:\Users\iLobster\Documents\ArduinoData\packages -hardware C:\Users\iLobster\Documents\Arduino\hardware -tools C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.10.0_x86__mdqgnx93n4wtt\tools-builder -tools C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.10.0_x86__mdqgnx93n4wtt\hardware\tools\avr -tools C:\Users\iLobster\Documents\ArduinoData\packages -built-in-libraries C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.10.0_x86__mdqgnx93n4wtt\libraries -libraries C:\Users\iLobster\Documents\Arduino\libraries -fqbn=HoodLoader2:avr:HoodLoader2atmega16u2:board=uno -ide-version=10805 -build-path C:\Users\iLobster\AppData\Local\Temp\arduino_build_535860 -warnings=none -build-cache C:\Users\iLobster\AppData\Local\Temp\arduino_cache_322616 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=C:\Users\iLobster\Documents\ArduinoData\packages\arduino\tools\avrdude\6.3.0-arduino9 -prefs=runtime.tools.arduinoOTA.path=C:\Users\iLobster\Documents\ArduinoData\packages\arduino\tools\arduinoOTA\1.1.1 -prefs=runtime.tools.avr-gcc.path=C:\Users\iLobster\Documents\ArduinoData\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2 -verbose C:\Users\iLobster\Documents\Arduino\libraries\KeyboardioHID\examples\Keyboard\KeyboardLed\KeyboardLed.ino
Using board 'HoodLoader2atmega16u2' from platform in folder: C:\Users\iLobster\Documents\Arduino\hardware\HoodLoader2\avr
Using core 'arduino' from platform in folder: C:\Users\iLobster\Documents\ArduinoData\packages\arduino\hardware\avr\1.6.21
Detecting libraries used...
"C:\Users\iLobster\Documents\ArduinoData\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega16u2 -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_HOODLOADER2 -DARDUINO_ARCH_AVR -DUSB_VID=0x2341 -DUSB_PID=0x484C '-DUSB_MANUFACTURER="Nico Hood"' '-DUSB_PRODUCT="HoodLoader2 16u2"' -DMAGIC_KEY_POS=(RAMEND-1) -DUSB_EP_SIZE=16 "-IC:\Users\iLobster\Documents\ArduinoData\packages\arduino\hardware\avr\1.6.21\cores\arduino" "-IC:\Users\iLobster\Documents\Arduino\hardware\HoodLoader2\avr\variants\HoodLoader2" "C:\Users\iLobster\AppData\Local\Temp\arduino_build_535860\sketch\KeyboardLed.ino.cpp" -o "nul"
"C:\Users\iLobster\Documents\ArduinoData\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega16u2 -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_HOODLOADER2 -DARDUINO_ARCH_AVR -DUSB_VID=0x2341 -DUSB_PID=0x484C '-DUSB_MANUFACTURER="Nico Hood"' '-DUSB_PRODUCT="HoodLoader2 16u2"' -DMAGIC_KEY_POS=(RAMEND-1) -DUSB_EP_SIZE=16 "-IC:\Users\iLobster\Documents\ArduinoData\packages\arduino\hardware\avr\1.6.21\cores\arduino" "-IC:\Users\iLobster\Documents\Arduino\hardware\HoodLoader2\avr\variants\HoodLoader2" "-IC:\Users\iLobster\Documents\Arduino\libraries\KeyboardioHID\src" "C:\Users\iLobster\AppData\Local\Temp\arduino_build_535860\sketch\KeyboardLed.ino.cpp" -o "nul"
"C:\Users\iLobster\Documents\ArduinoData\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega16u2 -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_HOODLOADER2 -DARDUINO_ARCH_AVR -DUSB_VID=0x2341 -DUSB_PID=0x484C '-DUSB_MANUFACTURER="Nico Hood"' '-DUSB_PRODUCT="HoodLoader2 16u2"' -DMAGIC_KEY_POS=(RAMEND-1) -DUSB_EP_SIZE=16 "-IC:\Users\iLobster\Documents\ArduinoData\packages\arduino\hardware\avr\1.6.21\cores\arduino" "-IC:\Users\iLobster\Documents\Arduino\hardware\HoodLoader2\avr\variants\HoodLoader2" "-IC:\Users\iLobster\Documents\Arduino\libraries\KeyboardioHID\src" "-IC:\Users\iLobster\Documents\ArduinoData\packages\arduino\hardware\avr\1.6.21\libraries\HID\src" "C:\Users\iLobster\AppData\Local\Temp\arduino_build_535860\sketch\KeyboardLed.ino.cpp" -o "nul"
"C:\Users\iLobster\Documents\ArduinoData\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega16u2 -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_HOODLOADER2 -DARDUINO_ARCH_AVR -DUSB_VID=0x2341 -DUSB_PID=0x484C '-DUSB_MANUFACTURER="Nico Hood"' '-DUSB_PRODUCT="HoodLoader2 16u2"' -DMAGIC_KEY_POS=(RAMEND-1) -DUSB_EP_SIZE=16 "-IC:\Users\iLobster\Documents\ArduinoData\packages\arduino\hardware\avr\1.6.21\cores\arduino" "-IC:\Users\iLobster\Documents\Arduino\hardware\HoodLoader2\avr\variants\HoodLoader2" "-IC:\Users\iLobster\Documents\Arduino\libraries\KeyboardioHID\src" "-IC:\Users\iLobster\Documents\ArduinoData\packages\arduino\hardware\avr\1.6.21\libraries\HID\src" "C:\Users\iLobster\Documents\Arduino\libraries\KeyboardioHID\src\BootKeyboard\BootKeyboard.cpp" -o "nul"
"C:\Users\iLobster\Documents\ArduinoData\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega16u2 -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_HOODLOADER2 -DARDUINO_ARCH_AVR -DUSB_VID=0x2341 -DUSB_PID=0x484C '-DUSB_MANUFACTURER="Nico Hood"' '-DUSB_PRODUCT="HoodLoader2 16u2"' -DMAGIC_KEY_POS=(RAMEND-1) -DUSB_EP_SIZE=16 "-IC:\Users\iLobster\Documents\ArduinoData\packages\arduino\hardware\avr\1.6.21\cores\arduino" "-IC:\Users\iLobster\Documents\Arduino\hardware\HoodLoader2\avr\variants\HoodLoader2" "-IC:\Users\iLobster\Documents\Arduino\libraries\KeyboardioHID\src" "-IC:\Users\iLobster\Documents\ArduinoData\packages\arduino\hardware\avr\1.6.21\libraries\HID\src" "C:\Users\iLobster\Documents\Arduino\libraries\KeyboardioHID\src\MultiReport\AbsoluteMouse.cpp" -o "nul"
"C:\Users\iLobster\Documents\ArduinoData\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega16u2 -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_HOODLOADER2 -DARDUINO_ARCH_AVR -DUSB_VID=0x2341 -DUSB_PID=0x484C '-DUSB_MANUFACTURER="Nico Hood"' '-DUSB_PRODUCT="HoodLoader2 16u2"' -DMAGIC_KEY_POS=(RAMEND-1) -DUSB_EP_SIZE=16 "-IC:\Users\iLobster\Documents\ArduinoData\packages\arduino\hardware\avr\1.6.21\cores\arduino" "-IC:\Users\iLobster\Documents\Arduino\hardware\HoodLoader2\avr\variants\HoodLoader2" "-IC:\Users\iLobster\Documents\Arduino\libraries\KeyboardioHID\src" "-IC:\Users\iLobster\Documents\ArduinoData\packages\arduino\hardware\avr\1.6.21\libraries\HID\src" "C:\Users\iLobster\Documents\Arduino\libraries\KeyboardioHID\src\MultiReport\ConsumerControl.cpp" -o "nul"
"C:\Users\iLobster\Documents\ArduinoData\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega16u2 -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_HOODLOADER2 -DARDUINO_ARCH_AVR -DUSB_VID=0x2341 -DUSB_PID=0x484C '-DUSB_MANUFACTURER="Nico Hood"' '-DUSB_PRODUCT="HoodLoader2 16u2"' -DMAGIC_KEY_POS=(RAMEND-1) -DUSB_EP_SIZE=16 "-IC:\Users\iLobster\Documents\ArduinoData\packages\arduino\hardware\avr\1.6.21\cores\arduino" "-IC:\Users\iLobster\Documents\Arduino\hardware\HoodLoader2\avr\variants\HoodLoader2" "-IC:\Users\iLobster\Documents\Arduino\libraries\KeyboardioHID\src" "-IC:\Users\iLobster\Documents\ArduinoData\packages\arduino\hardware\avr\1.6.21\libraries\HID\src" "C:\Users\iLobster\Documents\Arduino\libraries\KeyboardioHID\src\MultiReport\Gamepad.cpp" -o "nul"
"C:\Users\iLobster\Documents\ArduinoData\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega16u2 -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_HOODLOADER2 -DARDUINO_ARCH_AVR -DUSB_VID=0x2341 -DUSB_PID=0x484C '-DUSB_MANUFACTURER="Nico Hood"' '-DUSB_PRODUCT="HoodLoader2 16u2"' -DMAGIC_KEY_POS=(RAMEND-1) -DUSB_EP_SIZE=16 "-IC:\Users\iLobster\Documents\ArduinoData\packages\arduino\hardware\avr\1.6.21\cores\arduino" "-IC:\Users\iLobster\Documents\Arduino\hardware\HoodLoader2\avr\variants\HoodLoader2" "-IC:\Users\iLobster\Documents\Arduino\libraries\KeyboardioHID\src" "-IC:\Users\iLobster\Documents\ArduinoData\packages\arduino\hardware\avr\1.6.21\libraries\HID\src" "C:\Users\iLobster\Documents\Arduino\libraries\KeyboardioHID\src\MultiReport\Keyboard.cpp" -o "nul"
"C:\Users\iLobster\Documents\ArduinoData\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega16u2 -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_HOODLOADER2 -DARDUINO_ARCH_AVR -DUSB_VID=0x2341 -DUSB_PID=0x484C '-DUSB_MANUFACTURER="Nico Hood"' '-DUSB_PRODUCT="HoodLoader2 16u2"' -DMAGIC_KEY_POS=(RAMEND-1) -DUSB_EP_SIZE=16 "-IC:\Users\iLobster\Documents\ArduinoData\packages\arduino\hardware\avr\1.6.21\cores\arduino" "-IC:\Users\iLobster\Documents\Arduino\hardware\HoodLoader2\avr\variants\HoodLoader2" "-IC:\Users\iLobster\Documents\Arduino\libraries\KeyboardioHID\src" "-IC:\Users\iLobster\Documents\ArduinoData\packages\arduino\hardware\avr\1.6.21\libraries\HID\src" "C:\Users\iLobster\Documents\Arduino\libraries\KeyboardioHID\src\MultiReport\Mouse.cpp" -o "nul"
"C:\Users\iLobster\Documents\ArduinoData\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega16u2 -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_HOODLOADER2 -DARDUINO_ARCH_AVR -DUSB_VID=0x2341 -DUSB_PID=0x484C '-DUSB_MANUFACTURER="Nico Hood"' '-DUSB_PRODUCT="HoodLoader2 16u2"' -DMAGIC_KEY_POS=(RAMEND-1) -DUSB_EP_SIZE=16 "-IC:\Users\iLobster\Documents\ArduinoData\packages\arduino\hardware\avr\1.6.21\cores\arduino" "-IC:\Users\iLobster\Documents\Arduino\hardware\HoodLoader2\avr\variants\HoodLoader2" "-IC:\Users\iLobster\Documents\Arduino\libraries\KeyboardioHID\src" "-IC:\Users\iLobster\Documents\ArduinoData\packages\arduino\hardware\avr\1.6.21\libraries\HID\src" "C:\Users\iLobster\Documents\Arduino\libraries\KeyboardioHID\src\MultiReport\SystemControl.cpp" -o "nul"
"C:\Users\iLobster\Documents\ArduinoData\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega16u2 -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_HOODLOADER2 -DARDUINO_ARCH_AVR -DUSB_VID=0x2341 -DUSB_PID=0x484C '-DUSB_MANUFACTURER="Nico Hood"' '-DUSB_PRODUCT="HoodLoader2 16u2"' -DMAGIC_KEY_POS=(RAMEND-1) -DUSB_EP_SIZE=16 "-IC:\Users\iLobster\Documents\ArduinoData\packages\arduino\hardware\avr\1.6.21\cores\arduino" "-IC:\Users\iLobster\Documents\Arduino\hardware\HoodLoader2\avr\variants\HoodLoader2" "-IC:\Users\iLobster\Documents\Arduino\libraries\KeyboardioHID\src" "-IC:\Users\iLobster\Documents\ArduinoData\packages\arduino\hardware\avr\1.6.21\libraries\HID\src" "C:\Users\iLobster\Documents\Arduino\libraries\KeyboardioHID\src\SingleReport\SingleAbsoluteMouse.cpp" -o "nul"
"C:\Users\iLobster\Documents\ArduinoData\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega16u2 -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_HOODLOADER2 -DARDUINO_ARCH_AVR -DUSB_VID=0x2341 -DUSB_PID=0x484C '-DUSB_MANUFACTURER="Nico Hood"' '-DUSB_PRODUCT="HoodLoader2 16u2"' -DMAGIC_KEY_POS=(RAMEND-1) -DUSB_EP_SIZE=16 "-IC:\Users\iLobster\Documents\ArduinoData\packages\arduino\hardware\avr\1.6.21\cores\arduino" "-IC:\Users\iLobster\Documents\Arduino\hardware\HoodLoader2\avr\variants\HoodLoader2" "-IC:\Users\iLobster\Documents\Arduino\libraries\KeyboardioHID\src" "-IC:\Users\iLobster\Documents\ArduinoData\packages\arduino\hardware\avr\1.6.21\libraries\HID\src" "C:\Users\iLobster\Documents\ArduinoData\packages\arduino\hardware\avr\1.6.21\libraries\HID\src\HID.cpp" -o "nul"
Generating function prototypes...
"C:\Users\iLobster\Documents\ArduinoData\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega16u2 -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_HOODLOADER2 -DARDUINO_ARCH_AVR -DUSB_VID=0x2341 -DUSB_PID=0x484C '-DUSB_MANUFACTURER="Nico Hood"' '-DUSB_PRODUCT="HoodLoader2 16u2"' -DMAGIC_KEY_POS=(RAMEND-1) -DUSB_EP_SIZE=16 "-IC:\Users\iLobster\Documents\ArduinoData\packages\arduino\hardware\avr\1.6.21\cores\arduino" "-IC:\Users\iLobster\Documents\Arduino\hardware\HoodLoader2\avr\variants\HoodLoader2" "-IC:\Users\iLobster\Documents\Arduino\libraries\KeyboardioHID\src" "-IC:\Users\iLobster\Documents\ArduinoData\packages\arduino\hardware\avr\1.6.21\libraries\HID\src" "C:\Users\iLobster\AppData\Local\Temp\arduino_build_535860\sketch\KeyboardLed.ino.cpp" -o "C:\Users\iLobster\AppData\Local\Temp\arduino_build_535860\preproc\ctags_target_for_gcc_minus_e.cpp"
"C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.10.0_x86__mdqgnx93n4wtt\tools-builder\ctags\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\Users\iLobster\AppData\Local\Temp\arduino_build_535860\preproc\ctags_target_for_gcc_minus_e.cpp"
Compiling sketch...
"C:\Users\iLobster\Documents\ArduinoData\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega16u2 -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_HOODLOADER2 -DARDUINO_ARCH_AVR -DUSB_VID=0x2341 -DUSB_PID=0x484C '-DUSB_MANUFACTURER="Nico Hood"' '-DUSB_PRODUCT="HoodLoader2 16u2"' -DMAGIC_KEY_POS=(RAMEND-1) -DUSB_EP_SIZE=16 "-IC:\Users\iLobster\Documents\ArduinoData\packages\arduino\hardware\avr\1.6.21\cores\arduino" "-IC:\Users\iLobster\Documents\Arduino\hardware\HoodLoader2\avr\variants\HoodLoader2" "-IC:\Users\iLobster\Documents\Arduino\libraries\KeyboardioHID\src" "-IC:\Users\iLobster\Documents\ArduinoData\packages\arduino\hardware\avr\1.6.21\libraries\HID\src" "C:\Users\iLobster\AppData\Local\Temp\arduino_build_535860\sketch\KeyboardLed.ino.cpp" -o "C:\Users\iLobster\AppData\Local\Temp\arduino_build_535860\sketch\KeyboardLed.ino.cpp.o"
In file included from C:\Users\iLobster\Documents\Arduino\libraries\KeyboardioHID\src/KeyboardioHID.h:48:0,

             from C:\Users\iLobster\Documents\Arduino\libraries\KeyboardioHID\examples\Keyboard\KeyboardLed\KeyboardLed.ino:15:

C:\Users\iLobster\Documents\Arduino\libraries\KeyboardioHID\src/MultiReport/Keyboard.h: In member function 'uint8_t Keyboard_::getLEDs()':

C:\Users\iLobster\Documents\Arduino\libraries\KeyboardioHID\src/MultiReport/Keyboard.h:62:36: error: 'class HID_' has no member named 'getLEDs'

uint8_t getLEDs() { return HID().getLEDs(); };

                                ^

Using library KeyboardioHID at version 0.0.1 in folder: C:\Users\iLobster\Documents\Arduino\libraries\KeyboardioHID
Using library HID at version 1.0 in folder: C:\Users\iLobster\Documents\ArduinoData\packages\arduino\hardware\avr\1.6.21\libraries\HID
exit status 1
Error compiling for board HoodLoader2 16u2.

HID_SYSTEM_WAKEUP is unimplemented for GD32

void SystemControl_::press(uint8_t s) {
if (s == HID_SYSTEM_WAKE_UP) {
#ifdef __AVR__
USBDevice.wakeupHost();
#endif
#ifdef ARDUINO_ARCH_SAMD
// This is USBDevice_SAMD21G18x.wakeupHost(). But we can't include that
// header, because it redefines a few symbols, and causes linking
// errors. So we simply reimplement the same thing here.
USB->DEVICE.CTRLB.bit.UPRSM = 1;
#endif
} else {
sendReport(&s, sizeof(s));
}
}

HID_SYSTEM_WAKEUP is only implemented for AVR and SAMD, the GD32 implementation is missing.

Consumer_PlaySlashPause occasionally double registers.

Pressing on the key mapped to Consumer_PlaySlashPause occasionally registers two presses in one press. A quick test gives me two such incidents in 20 attempts.

My mapping places the play/pause key where the factory default layout has the ‘any key’, as can be seen on line 78 of this snippet. However, a quick test of 20 presses of that physical key, but under a different layer, does not give any double presses.

I reported elsewhere that Consumer_ScanNextTrack skips two tracks consistently, but I decided to make sure it was actually the Model01 with that problem. I plugged in a different keyboard with that key, and it had the same problem. That other keyboard could not be made to manifest the problem with play/pause, so that problem remains.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.