Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge KeyboardioHID into plugins #1372

Merged
merged 599 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
599 commits
Select commit Hold shift + click to select a range
728224c
Remove indirection from Gamepad code
obra Dec 10, 2015
fd9ebf6
Remove Boot Protocol Mouse;Remove MouseAPI layer of indirection
obra Dec 10, 2015
7b798b6
Remove consumer control from BootKeyboard
obra Dec 10, 2015
1c83aba
Remove layer of indirection for ConsumerControl
obra Dec 10, 2015
3e53b9d
Fixup 'extra' includes
obra Dec 10, 2015
f431feb
Remove RawHID implementation. It's not yet working upstream and isn't…
obra Dec 10, 2015
394dec4
Remove ImprovedKeyboard sample code
obra Dec 10, 2015
ab3386b
Lift currently unused list of keyboard LEDs intto KeyboardAPI.h
obra Dec 10, 2015
4e85d8b
Rename 'SingleReport' to 'BootKeyboard'
obra Dec 11, 2015
1926b93
Rename HID-APIs to KeyboardCore, which is what it now is
obra Dec 11, 2015
d49ddf7
Add HIDTables from the old Keyboardio HID Keyboard implemenntation
obra Dec 11, 2015
36a328d
Remove old asciimap (now that we're only going to use the actual key …
obra Dec 11, 2015
fbddfba
Replacing the "release" -> "remove" delegated API with just using "re…
obra Dec 11, 2015
312c141
Migrate boot keyboard implementation into bootkeyboard
obra Dec 11, 2015
7ca2f04
Port some docs from the old Keybordio keyboard driver
obra Dec 11, 2015
d8ffc6e
minor whitespace cleanup
obra Dec 11, 2015
3198436
boot keyboard api cleanup
obra Dec 11, 2015
224c4b6
Point at the HID tables we actually use for the BootKeyboard code now
obra Dec 11, 2015
1022a06
Replacing send with sendReport for consistency and clarity
obra Dec 11, 2015
e83fa16
partial removal of old keycode based interface
obra Dec 11, 2015
17895b4
Lift 'begin' and 'end' from KeyboardCore to NKROKeyboard, since it wa…
obra Dec 11, 2015
afa8d9e
Remove now-unused KeyboardAPI
obra Dec 12, 2015
4117d8e
split 'set' into 'press' and 'release' as separate functions
obra Dec 12, 2015
5dbf471
Remove dependence on outdated KeyboardCore class
obra Dec 12, 2015
2ec4571
Lift HIDTables out of now empty directory
obra Dec 12, 2015
47d17f4
Restore lost LED definition
obra Dec 12, 2015
fc3b140
remove definition of obsolete API
obra Dec 12, 2015
80342ea
Switch to new HID Table definitions of the modifier keys.
obra Dec 12, 2015
94116bc
further removal of KeyboardKeycode data type
obra Dec 12, 2015
9e309e9
Get rid of usages of KEY_RESERVED being overloaded as 'no key'
obra Dec 12, 2015
eb3844a
Add a new header file for convenient alternate HID table points with …
obra Dec 12, 2015
83e2427
In a stunning display of usefulness, this recently added abstraction …
obra Dec 12, 2015
729cb7d
Fix the multiple-inclusion guard
obra Dec 12, 2015
03aa015
Fix cut and paste errors discovered when testing refactored code
obra Dec 12, 2015
e86bca7
Fix another cut and paste error from the great reflattening of the code
obra Dec 12, 2015
10dc5d0
Port Consumer Control implementation to using raw keycodes as uint16_ts
obra Dec 12, 2015
61cf468
sendReport isn't virtual anymore
obra Dec 12, 2015
bc447d1
Fix cut and paste errors from the great flattening of the gamepad api
obra Dec 12, 2015
6da64a5
correct prototype of BootKeyboard::press
obra Dec 12, 2015
be423cc
remove call to undefined setWriteError function
obra Dec 12, 2015
7e80942
BootKeyboard API fixup
obra Dec 12, 2015
e965e2c
Remove old custom SystemControl keycode table
obra Dec 12, 2015
cdd50e9
remove overloaded use of "no key defined" macro
obra Dec 12, 2015
9fdb818
SystemControl's SendReport isn't virtual
obra Dec 12, 2015
11a6ca7
Add a "write" method to BootKeyboard that presses and releases a key
obra Dec 12, 2015
272e31f
Export bootkeyboard's "begin" and "end" methods
obra Dec 12, 2015
00f7640
NKROKeyboard release takes a boring uint8_t
obra Dec 12, 2015
29f5db6
NKROKeyboard's 'sendReport' isn't virtual
obra Dec 12, 2015
d7cef8e
fixups from AbsoluteMouse flattening
obra Dec 12, 2015
59fd497
typo fixes from Gamepad flattening
obra Dec 12, 2015
784be6f
Fixing a missing macro replacement
obra Dec 12, 2015
2a67a55
Add easier to type HID keyboard aliases
obra Dec 12, 2015
91d4802
Remove the old ImprovedLayouts definitions we're not using anymore
obra Dec 12, 2015
520c97a
Previous refactoring accidentally used .keys instead of .keycodes.
obra Dec 12, 2015
d8638cd
Unified code style with Artistic Style Version 2.05.1
obra Dec 12, 2015
4d4fa86
Fix a couple bad HID Aliases
obra Dec 12, 2015
27537eb
Now that we have a working ASCII map, port it to both keyboard variants.
obra Dec 12, 2015
71e2332
Now that we support 'write' again, expose the full Print API again
obra Dec 12, 2015
2541fab
de-inlineify nkrokeyboard API. Basic functionality is happy
obra Dec 12, 2015
7cc9270
Rename ImprovedMouse just to Mouse
obra Dec 12, 2015
bb773e1
Rename Consumer to ConsumerControl
obra Dec 12, 2015
ea0a7c3
Rename System to SystemControl
obra Dec 12, 2015
b46c66d
Remove unused keywords
obra Dec 12, 2015
258fb72
NKROKeyboard becomes just "Keyboard" as NKRO is just one feature
obra Dec 12, 2015
617eb70
Added a 'make astyle' target
obra Dec 13, 2015
6f6b372
Linting turned up a stray - in some cpp macros
obra Dec 13, 2015
d36cdf0
Add a note about how to check that my HID macros aren't nutso
obra Dec 13, 2015
2072499
Upon closer reading of the spec, it's totally right to define a "no e…
obra Dec 13, 2015
82cbc56
Correct a duplicate macro in HIDAliases
obra Dec 13, 2015
7bea063
Add my nascent HID Descriptor primitive colleciton
obra Dec 13, 2015
bf4671d
Convert the NKRO Keyboard's descriptor to use my primitive library
obra Dec 13, 2015
b4f2e24
Add a note that a comment in the old implementation is not true for o…
obra Dec 14, 2015
c92bb3f
Remove the custom 'one key keyboard for things outside the boaring 10…
obra Dec 14, 2015
7537d31
Rename the boot keyboard's report data structure away from conflictin…
obra Dec 14, 2015
070ff95
Snapshot - functionality is happy on OSX, but not yet on linux or win…
obra Dec 14, 2015
8eef5f2
clean up and optimize .releaseAll()
obra Dec 14, 2015
422830b
Remove unecessary casts.
obra Dec 14, 2015
7604074
HID descriptor macros
obra Dec 14, 2015
10be535
Typo fix
obra Dec 17, 2015
9e6e6ca
Porting more hid descriptors to the new descriptor macros
obra Dec 17, 2015
43e77db
bad logic for adding modifiers.
obra Jan 20, 2016
2205351
Remove 'inline' function descriptions that just don't play nice
obra Jan 20, 2016
d842f8b
Reorder imports
obra Jan 20, 2016
7476738
Remove now-incorrect content from the README
obra Jan 20, 2016
7a3f0f1
update library properties to better match library
obra Jan 20, 2016
5d7c11b
Add some missing spaces on arrow key definiitons
obra Jan 22, 2016
97bd1df
releaseAll has no return value. Fix its prototype to show that
obra Jan 22, 2016
1c13075
Return a value on success in write();
obra Jan 22, 2016
faaff77
Rename the KeyboardioHID top-level header to the name of the project
obra Jan 30, 2016
b0f3086
Switch to using unsigned 0-65536 coordinates for absolute mouse
obra Feb 1, 2016
790f6d4
Revert "Switch to using unsigned 0-65536 coordinates for absolute mouse"
obra Feb 1, 2016
8cc1162
The previous value hadn't actually wrapped around
obra Feb 1, 2016
8e20f41
Explicitly specify that moveTo takes 16 bit parameters
obra Feb 1, 2016
75926e4
Switch to an 0-32767 space for the AbsoluteMouse. Seems to behave mor…
obra Feb 1, 2016
a02d395
[travis] Add build infrastructure that proves our sample code is made…
obra Feb 19, 2016
4bd6732
[travis] The local lib path is up one level
obra Feb 20, 2016
0007c98
Update examples so they compile
obra Feb 20, 2016
657c03c
Update makefile and travis config to automatically smoke all examples
obra Feb 20, 2016
613e0e6
Include the arduino ~core libraries.\n\nWe don't need it for this rep…
obra Feb 20, 2016
7a461b4
Make the hiding of Print::write explicit
algernon Oct 24, 2016
3e71c40
Add a method to return if a modifier is active
algernon Oct 29, 2016
a47c693
Remove all 'flexible arrays', which is not a valid C++ construct
DonOregano Jan 6, 2017
7d4a647
Don't implement Print for either of the keyboards
algernon Feb 18, 2017
b178136
Fix the examples to not use BootKeyboard.write()
algernon Feb 18, 2017
a230ce2
Fix the NKRO example too
algernon Feb 18, 2017
db4084a
improve namespacing for DescriptorPrimitives.h
wez May 6, 2017
16ae0b3
apply astyle
wez May 6, 2017
a7ca8a1
move mouse button defs to their own header file
wez May 6, 2017
8ac79cd
Remove legacy HIDAliases
wez May 8, 2017
bdc343f
Add .gitignore
wez May 8, 2017
be192e3
typo in hid table entry
obra May 17, 2017
2d5a223
make astyle
obra May 26, 2017
0cd9fa7
astyle with current project style guidelines
obra Jun 4, 2017
ac683bc
Add some guard code in sendReport to stop user code from needlessley
obra Jul 26, 2017
b063f47
Lift MouseButtons up one directory as part of a refactoring of the co…
obra Jul 28, 2017
5a9534c
Extract the brains of AbsoluteMouse to a bit of shared code
obra Jul 28, 2017
7b80c70
Use newly-reextracted AbsoluteMouseAPI
obra Jul 28, 2017
e41ff73
Reimport Nico's standalone absolute mouse class
obra Jul 28, 2017
48b2af9
Include singleabsolutemouse
obra Jul 28, 2017
56aff90
Refactor SingleAbsoluteMouse' HID descriptor to use our definition ma…
obra Jul 28, 2017
0da6ed7
downCase SendReport
obra Jul 28, 2017
c453101
Finish downcasing sendReport
obra Jul 28, 2017
eb13432
Use the alias we've already defined for the "top" of the keymap
obra Aug 13, 2017
c76b783
Add a new 'wasModifierActive' method to help introspect the last key …
obra Aug 13, 2017
c3f3d4d
Implement Keyboard.getLEDs()
algernon Oct 29, 2017
b0c9e2b
Support for Vertical mouse wheel movement.
SjB Nov 7, 2017
6b970c3
added documentation to Readme.md
SjB Nov 16, 2017
2541a62
ConsumerControl: Report separately from press / release
algernon Nov 24, 2017
bb32284
ConsumerControl: Guard the report
algernon Nov 28, 2017
fb4a2a0
Make the smoke tests use our version of the Arduino HID library,
obra Nov 29, 2017
95b3b2e
Second attempt at a travis recipe
obra Nov 29, 2017
221c33a
AbsMouse: Remove support for the horizontal scroll wheel
algernon Nov 29, 2017
e87f1ed
Made keyboard HID reports public
gedankenexperimenter Nov 26, 2017
09cea5d
Changed names of public key report variables
gedankenexperimenter Nov 29, 2017
de743be
Mouse: Rework the USB descriptors
algernon Nov 30, 2017
eeff0f6
Mouse: Pull sendReport out of move & buttons
algernon Nov 24, 2017
11dbb4d
Mouse: Guard sendReport() to only send reports on change
algernon Nov 28, 2017
53b8eca
Mouse: Only skip the report if it is both unchanged and empty
algernon Nov 29, 2017
f2d3c1d
Mouse: Simplified empty report comparison
algernon Nov 30, 2017
6dcc53c
Revert the Mouse USB HID descriptor change, and fix hWheel better
algernon Dec 8, 2017
2a7804d
Mouse: Cleaned up the comments on the descriptor
obra Dec 8, 2017
b84a348
Mouse: Append the descriptor late, in Mouse.begin
algernon Dec 1, 2017
2a80fda
BootKeyboard: Add a sendReport guard, and implement is/wasModifierActive
algernon Dec 1, 2017
226039f
BootKeyboard: Remove the (unused) consumer reports
algernon Dec 1, 2017
6bcce4a
BootKeyboard: Allow setting a default protocol
algernon Dec 1, 2017
7a1e67f
BootKeyboard: Implement a way to set the protocol forcibly
algernon Dec 1, 2017
f0ec9d7
BootKeyboard: Optimize the report sorting on release
algernon Dec 29, 2017
d041998
BootKeyboard: Drop support for FeatureReport and WakeupHost
algernon Dec 29, 2017
a5fb86f
Mouse: Add a missing REPORT_COUNT to the horizontal wheel Usage
algernon Jan 15, 2018
e0c80e6
Improved workaround for ChromeOS modifier bug
gedankenexperimenter Jan 23, 2018
dbd59e6
Simplified ChromeOS modifier bug workaround
gedankenexperimenter Jan 23, 2018
215adcf
Check return value of HID().SendReport()
gedankenexperimenter Jan 24, 2018
8fbee04
Keyboard: Don't skip NONUS_POUND and CLEAR
algernon Dec 20, 2017
ac51984
Fix up BootKeyboard to work under OSX
algernon May 28, 2018
82ec056
BootKeyboard: Use the HID descriptor macros
algernon May 28, 2018
ebee18c
Made Boot descriptor conform to spec.
May 30, 2018
7348e4e
BootKeyboard: default to BOOT protocol
algernon Jun 2, 2018
bb62a9d
BootKeyboard: Added explanatory comments about why we default to BOOT
algernon Jun 4, 2018
bfaa856
BootKeyboard: Fix modifier release
algernon Jun 5, 2018
4e6a45a
BootKeyboard: Disable HID_SET_IDLE
algernon Jun 5, 2018
b880a25
BootKeyboard: Move the plugging to .begin()
algernon Jun 7, 2018
fc8bad4
Revert BootKeyboard defaulting to BOOT protocol
algernon Jun 8, 2018
bf7e44f
We -always- want to restore the last key report, even if our USB send…
obra Jul 27, 2018
69fc3ea
Add new 'isKeyPressed/wasKeyPressed API to help calling code be more …
obra Jul 27, 2018
eeb55a0
The old behavior of always sending the old report with the new modifiers
obra Jul 27, 2018
797bfdf
Mouse: Implement Mouse_::stop()
algernon Jul 29, 2018
68ef9a3
Replace ::stop() with ::getReport()
algernon Jul 31, 2018
8cd0e4c
Sending an extra report when toggling off a Modifier leads to numerous
obra Aug 15, 2018
1efc77e
Revert "Sending an extra report when toggling off a Modifier leads to…
obra Aug 15, 2018
7283892
Do our report deduplication -before- we send the special OS-workaround
obra Aug 15, 2018
d8f0d06
Only send our modifier deduplication reports if a modifier is changing
obra Aug 15, 2018
4bc474d
Add a comment explaining weird behavior
obra Aug 15, 2018
0d46482
Add a LICENSE file, and proper headers to all files
algernon Aug 23, 2018
50b2581
Add CONTRIBUTING.md
algernon Aug 23, 2018
6457162
Travis cleanup
algernon Oct 10, 2018
a5d13b4
Add functions for determining whether any modifiers are/were active
tiltowait Jan 20, 2019
a1701ee
Copy HID.h and HID.cpp over
algernon Apr 19, 2019
0e5569e
library.properties: Switch the architecture to any
algernon Apr 19, 2019
9d6dfae
Don't include PluggableUSB.h directly
algernon Apr 19, 2019
1c5b597
Port the library to the Atmel SAMD core
algernon Apr 19, 2019
baee357
Ran make astyle
Jun 12, 2019
7175766
Added a hook for HID report notification
Jun 12, 2019
4929e61
Fixed a missing default implementation
Jun 13, 2019
55c097c
Conditionally build the HID core
Jun 13, 2019
6f68e09
Added a HIDReportObserver class
Jun 20, 2019
4c23aa7
SAMD: Fix the host wakeup code
algernon Nov 8, 2019
e744dd6
SAMD: Fix the descriptor sending
algernon Nov 13, 2019
c7d6358
HID_::SendReport_: Use a single send on SAMD
algernon Dec 6, 2019
a3f77b7
HID: Mark HID_::getShortName weak
algernon Dec 7, 2019
6ad9288
Delay appending the HID descriptors until .begin()
algernon Dec 13, 2019
72a89d2
Revert "Delay appending the HID descriptors until .begin()"
algernon Dec 17, 2019
d17e5b3
Update HIDTables.h to match USB-IF HID Usage tables 1.2
gedankenexperimenter Sep 14, 2020
e60d44f
remove an accidental extra space
obra Oct 4, 2020
4fdeb0e
Change `make astyle` to use the same options as Kaleidoscope
gedankenexperimenter Dec 4, 2020
7c097f0
Format code using new `make astyle` options
gedankenexperimenter Dec 4, 2020
7047afa
Remove unnecessary `void` in functions with no parameters
gedankenexperimenter Dec 4, 2020
511a2fc
Replace non-standard `boolean` with `bool`
gedankenexperimenter Dec 4, 2020
3fda973
Change variable names to conform to coding style guide
gedankenexperimenter Dec 4, 2020
fe02f45
Match variable names in header to those used in cpp file
gedankenexperimenter Dec 4, 2020
636e0a1
Standardize names of HID report variables across classes
gedankenexperimenter Dec 4, 2020
6299eb2
Format whitespace and comments for readability
gedankenexperimenter Dec 4, 2020
a3b42c3
Replace `signed char` with `int8_t`
gedankenexperimenter Dec 4, 2020
9230c64
Untabify comments in HID descriptor definitions
gedankenexperimenter Dec 4, 2020
203b4ff
Improve handling of simultaneous changes in a single NKRO report
gedankenexperimenter Dec 5, 2020
ef97b85
Make Keyboard HID report data variables private
gedankenexperimenter Apr 13, 2021
bc0e726
Fix HID_SET_IDLE
algernon Sep 28, 2021
40a61fe
BootKeyboard: Reorganize how the default protocol can be set
algernon Nov 2, 2021
2c8b9a2
Add very basic gdb32 support
algernon Oct 30, 2021
ef5a314
Fixes for GD32 architecture.
bjc Nov 12, 2021
0357aa7
TRANSFER_ macros are now in the USB core
obra Nov 10, 2021
19fac65
Explicitly pack ‘HIDDescriptor’ and ‘HIDDescDescriptor’.
bjc Nov 12, 2021
e7fc3c6
Remove USB definitions for GD32 that are now in the arduino core
obra Dec 9, 2021
56d8f94
Fix init order warning for BootKeyboard constructor
gedankenexperimenter Dec 14, 2021
8f01fa1
Until Kaleidoscope supports CDC-ACM, we need to rRevert "Remove USB d…
obra Jan 12, 2022
a451aeb
Revert "Until Kaleidoscope supports CDC-ACM, we need to rRevert "Remo…
obra Feb 8, 2022
bb24bec
We always require PluggableUSB
obra Feb 16, 2022
56e1bb3
remove redundant definition
obra Feb 16, 2022
60c9686
Remove redundant include
obra Feb 16, 2022
15acaca
Add some bulletproofing against future improvement to the GD32 USB core
obra Feb 16, 2022
ba611aa
Pack the struct for AbsoluteMouse, otherwise we end up with 8 bit
obra Feb 17, 2022
c275c18
Specify a default HID EP buffer size when we don't have one manually …
obra Feb 17, 2022
1cd384e
Give BootKeyboard a custom EP buffer size on platforms that support it
obra Feb 17, 2022
b93f58b
Give AbsMouse a 6 byte buffer when we can
obra Feb 17, 2022
4146c4f
Use the fancy new EP definitions on GD32
obra Feb 17, 2022
50ca989
GD32 has customizable buffer sizes
obra Feb 17, 2022
484945a
Fixes for broken refactoring that added GD32 customizable endpoint si…
obra Mar 1, 2022
74f526f
On GD32, PluggableUSB.h is inside api/, but it's also already include…
obra Mar 2, 2022
90bb647
Simplify and correct check for no-op Mouse HID reports
gedankenexperimenter Mar 9, 2022
cf52807
Correct Mouse HID `click()` method
gedankenexperimenter Mar 9, 2022
f0f5812
Create unions for fields we receive from the host with bbacking
obra Apr 3, 2022
0a16c66
Fixups to the last commit
obra Apr 3, 2022
0b59afd
Fixup the previous commit
obra Apr 4, 2022
7a4cdc1
Revert "Fixup the previous commit"
gedankenexperimenter Apr 5, 2022
d6b9470
Revert "Fixups to the last commit"
gedankenexperimenter Apr 5, 2022
9f832ba
Revert "Merge pull request #83 from keyboardio/f/gd32-16-bit-workaround"
gedankenexperimenter Apr 5, 2022
fdce7e3
Alternate workaround for the GD32 `uint_16t*` cast bug
gedankenexperimenter Apr 5, 2022
2f6c1be
Fixes for USB REPORT handling on GD32
obra Jun 1, 2022
eddcf51
We inherited code from Nico Hood's HID project that would always send a
obra Jun 6, 2022
32d4938
SystemControl: Restore release() and releaseAll()
algernon Oct 2, 2022
63ebe0a
fix NKRO report fencepost
tlyu Nov 3, 2022
9293b69
reject Get/Set Protocol for non-boot
tlyu Nov 4, 2022
5ffbead
fix get/set idle
tlyu Nov 8, 2022
7f6c2c8
reset protocol on bus reset
tlyu Nov 4, 2022
eed8fac
make BootKeyboard first HID
tlyu Jan 12, 2023
b283696
use an action hook onReset for BootKeyboard
tlyu Jan 15, 2023
3bfb7e5
remove GD32 `recvControl` workaround
tlyu Feb 11, 2023
ad49b87
use pointer collection in mouse descriptors
tlyu Dec 6, 2023
9da5316
BootKeyboard: use positive Logical Maximum
tlyu Dec 14, 2023
f3c5cdc
Update KeyboardioHID formatting to Kaleidoscope style
obra Dec 14, 2023
0f02af7
cpplint's required corrections
obra Dec 14, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions plugins/KeyboardioHID/.astylerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
style=google
unpad-paren
pad-header
pad-oper
indent-classes
indent=spaces=2
max-continuation-indent=80
3 changes: 3 additions & 0 deletions plugins/KeyboardioHID/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*~
.#*
.*swp*
18 changes: 18 additions & 0 deletions plugins/KeyboardioHID/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
language: c
before_install:
- pushd ..
- wget http://downloads.arduino.cc/arduino-1.6.7-linux64.tar.xz
- tar xf arduino-1.6.7-linux64.tar.xz
- popd
script:
- git clone https://github.com/keyboardio/Arduino-HID ../HID
- make smoke ARDUINO_PATH=../arduino-1.6.7 ARDUINO_LOCAL_LIB_PATH=..

notifications:
email:
on_success: change
on_failure: change
slack:
secure: geVAHVhYQ5bY7ja5vx1Tgxc5y64WLuXVEWKmw4LqiThFYCjtpdWkHGiZJfhUwkVI11u5w8w1FUmrB7ZP4EUGoXhCK/z1mvVMVJ9+fS+WoaqcTHFJi0hGbvXaFPD7QA+ef7TLrFcU643kf6KHN/P+dVVndLyhctXZqOZHHwXmKZNMt8qM5Gh5h41HOi0YjT9yFafSU0qf5jphF5qvjlxKsVJF+WxtMSU4xMYxzq7rf80bPi2pu4ijgqR5+Haaa71DJ1V2TA4wZ+BFTBo2YUJIGZ8qDlqmb7RdF/u72G/8HbT/Hzj55blrpBXU/BPkokGOPJlIGHPV76ESpJI0ZUILRifmkZY6ylMjl/hutDYPNjhMq8Z/UKSLN6pJQAq0PjqAoHCtPsXTbRMT0lhVt2itkCPwAXVgszTrE6INsNylY/soaDu66Sjmz2zQH8sC6hbL8SrZ0xGs1Q+e3q5WMETPIAS9f4n2YCxkIz4ORoL9IrOXUcebVNriiWKzOBt6bleWPJlGc6yVYkkUhvURH+jEp6v2Y5SqsaJVTD3I5Gq/H/0PJBtPdzu470yQ3/FD4g6M0AmWx8DCuvl1O295QOZbUtujpIowTm7PynFrAgW3ptSidjzWjzZaHc0iQJBiNi86dg3GomoEEOPzx8hnX7fhFgsR+Ixqfzx0srrQYqleQGY=
cache:
ccache: true
50 changes: 50 additions & 0 deletions plugins/KeyboardioHID/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Developer Certificate of Origin

All contributions must include acceptance of the DCO:

```
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or

(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or

(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.

(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
```

## Sign your work

To accept the DCO, please add this line to each commit message with your name
and email address (`git commit -s` will do this for you):

Signed-off-by: Jane Example <[email protected]>
22 changes: 22 additions & 0 deletions plugins/KeyboardioHID/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
The MIT License (MIT)

Copyright (c) 2014-2015 NicoHood
Copyright (c) 2015-2018 Keyboard.io, Inc

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
39 changes: 39 additions & 0 deletions plugins/KeyboardioHID/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Arduino Make file. Refer to https://github.com/sudar/Arduino-Makefile

#BOARD_TAG = keyboardio
BOARD = model01
MCU = atmega32u4

ARDUINO_LIBS =

ARDUINO_PATH ?= /Applications/Arduino.app/Contents/Java/
ARDUINO_TOOLS_PATH=$(ARDUINO_PATH)/hardware/tools
FQBN=arduino:avr:leonardo
BUILD_PATH := $(shell mktemp -d 2>/dev/null || mktemp -d -t 'build')
ARDUINO_LOCAL_LIB_PATH=~/Documents/Arduino/libraries
ARDUINO_IDE_VERSION=100607
VERBOSE := #-verbose

EXAMPLES=$(shell find ./examples -type f -name \*.ino )
EXAMPLES_HEX := $(addsuffix .hex,${EXAMPLES})


astyle:
astyle --project --recursive "src/*.cpp,*.h,*.ino"

smoke: ${EXAMPLES_HEX}

${EXAMPLES_HEX}: %.hex:

$(ARDUINO_PATH)/arduino-builder \
-hardware $(ARDUINO_PATH)/hardware \
-tools $(ARDUINO_TOOLS_PATH) \
-tools $(ARDUINO_PATH)/tools-builder \
-fqbn $(FQBN) \
-libraries $(ARDUINO_PATH)/libraries \
-libraries $(ARDUINO_LOCAL_LIB_PATH) \
$(VERBOSE) \
-build-path $(BUILD_PATH) \
-ide-version $(ARDUINO_IDE_VERSION) \
$*
$(ARDUINO_TOOLS_PATH)/avr/bin/avr-size -C --mcu=$(MCU) $(BUILD_PATH)/$(shell basename $*).elf
14 changes: 14 additions & 0 deletions plugins/KeyboardioHID/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
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)

3 changes: 3 additions & 0 deletions plugins/KeyboardioHID/doc/notes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
To expand the macros in a c++ source file on OSX:

gcc -D __AVR_ATmega32U4__ -DF_CPU=16000000L -O -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/ -I /Applications/Arduino.app/Contents/Java/hardware/tools/avr/avr/include/ -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/leonardo -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/HID/ -I. -E $FILE
36 changes: 36 additions & 0 deletions plugins/KeyboardioHID/examples/Consumer/Consumer.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
Copyright (c) 2014-2015 NicoHood
See the readme for credit to other people.

Consumer example
Press a button to play/pause music player

See HID Project documentation for more Consumer keys.
https://github.com/NicoHood/HID/wiki/Consumer-API
*/

#include "KeyboardioHID.h"

const int pinLed = LED_BUILTIN;
const int pinButton = 2;

void setup() {
pinMode(pinLed, OUTPUT);
pinMode(pinButton, INPUT_PULLUP);

// Sends a clean report to the host. This is important on any Arduino type.
ConsumerControl.begin();
}

void loop() {
if (!digitalRead(pinButton)) {
digitalWrite(pinLed, HIGH);

// See HID Project documentation for more Consumer keys
ConsumerControl.write(HID_CONSUMER_PLAY_SLASH_PAUSE);

// Simple debounce
delay(300);
digitalWrite(pinLed, LOW);
}
}
65 changes: 65 additions & 0 deletions plugins/KeyboardioHID/examples/Gamepad/Gamepad.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/*
Copyright (c) 2014-2015 NicoHood
See the readme for credit to other people.

Gamepad example
Press a button and demonstrate Gamepad actions

You can also use Gamepad1,2,3 and 4 as single report.
This will use 1 endpoint for each gamepad.

See HID Project documentation for more infos
https://github.com/NicoHood/HID/wiki/Gamepad-API
*/

#include "KeyboardioHID.h"

const int pinLed = LED_BUILTIN;
const int pinButton = 2;

void setup() {
pinMode(pinLed, OUTPUT);
pinMode(pinButton, INPUT_PULLUP);

// Sends a clean report to the host. This is important on any Arduino type.
Gamepad.begin();
}

void loop() {
if (!digitalRead(pinButton)) {
digitalWrite(pinLed, HIGH);

// Press button 1-32
static uint8_t count = 0;
count++;
if (count == 33) {
Gamepad.releaseAll();
count = 0;
} else
Gamepad.press(count);

// Move x/y Axis to a new position (16bit)
Gamepad.xAxis(random(0xFFFF));
Gamepad.yAxis(random(0xFFFF));

// Go through all dPad positions
// values: 0-8 (0==centered)
static uint8_t dpad1 = GAMEPAD_DPAD_CENTERED;
Gamepad.dPad1(dpad1++);
if (dpad1 > GAMEPAD_DPAD_UP_LEFT)
dpad1 = GAMEPAD_DPAD_CENTERED;

static int8_t dpad2 = GAMEPAD_DPAD_CENTERED;
Gamepad.dPad2(dpad2--);
if (dpad2 < GAMEPAD_DPAD_CENTERED)
dpad2 = GAMEPAD_DPAD_UP_LEFT;

// Functions above only set the values.
// This writes the report to the host.
Gamepad.write();

// Simple debounce
delay(300);
digitalWrite(pinLed, LOW);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
Copyright (c) 2014-2015 NicoHood
See the readme for credit to other people.

BootKeyboard example

Shows that keyboard works even in bios.
Led indicats if we are in bios.

See HID Project documentation for more information.
https://github.com/NicoHood/HID/wiki/Keyboard-API#boot-keyboard
*/

#include "KeyboardioHID.h"

const int pinLed = LED_BUILTIN;
const int pinButton = 2;

void setup() {
pinMode(pinLed, OUTPUT);
pinMode(pinButton, INPUT_PULLUP);

// Sends a clean report to the host. This is important on any Arduino type.
BootKeyboard.begin();
}


void loop() {
// Light led if keyboard uses the boot protocol (normally while in bios)
// Keep in mind that on a 16u2 and Arduino Micro HIGH and LOW for TX/RX Leds are inverted.
if (BootKeyboard.getProtocol() == HID_BOOT_PROTOCOL)
digitalWrite(pinLed, HIGH);
else
digitalWrite(pinLed, LOW);

// Trigger caps lock manually via button
if (!digitalRead(pinButton)) {
BootKeyboard.press(HID_KEYBOARD_ENTER);
BootKeyboard.sendReport();
BootKeyboard.releaseAll();
BootKeyboard.sendReport();

// Simple debounce
delay(300);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
Copyright (c) 2014-2015 NicoHood
See the readme for credit to other people.

KeyboardLed example

Press a button to toogle caps lock.
Caps lock state is represented by the onboard led.
Leds are only supported on single report HID devices.

See HID Project documentation for more information.
https://github.com/NicoHood/HID/wiki/Keyboard-API
*/

#include "KeyboardioHID.h"

const int pinLed = LED_BUILTIN;
const int pinButton = 2;

void setup() {
pinMode(pinLed, OUTPUT);
pinMode(pinButton, INPUT_PULLUP);

// Sends a clean report to the host. This is important on any Arduino type.
BootKeyboard.begin();
}


void loop() {
// Update Led equal to the caps lock state.
// Keep in mind that on a 16u2 and Arduino Micro HIGH and LOW for TX/RX Leds are inverted.
if (BootKeyboard.getLeds() & LED_CAPS_LOCK)
digitalWrite(pinLed, HIGH);
else
digitalWrite(pinLed, LOW);

// Trigger caps lock manually via button
if (!digitalRead(pinButton)) {
BootKeyboard.press(HID_KEYBOARD_CAPS_LOCK);
BootKeyboard.sendReport();
BootKeyboard.releaseAll();
BootKeyboard.sendReport();

// Simple debounce
delay(300);
}
}
Loading
Loading