Keyboard icon indicating copy to clipboard operation
Keyboard copied to clipboard

Add additional examples as seen on arduino.cc

Open nnaka opened this issue 5 years ago • 5 comments

Following https://github.com/arduino-libraries/Keyboard/pull/29, I went ahead and added the rest of the examples that I found on arduino.cc. Once again, this is not my code, and I am simply making consistent in Github what I see on the official website.

Sources:

I noticed that the website itself contains [Get Code] links which are often broken or don't link to the source-code. I think it would be cool if we could change the links there to come to the examples here. I found this, but wasn't able to find the content for the specific example pages for which I could submit a PR. Please let me know if you have any advice on this!

nnaka avatar Mar 07 '20 23:03 nnaka

As a side note, I also noticed that this repo doesn't have CI set up. I think it might be worth having even just a code style formatter. I can create a separate PR with the yml file if you think it would be helpful.

nnaka avatar Mar 08 '20 00:03 nnaka

I think it might be worth having even just a code style formatter

See https://github.com/arduino-libraries/Arduino_MKRGPS/pull/1 for a lot of discussion that resulted from my attempt to do this. At that time we were using Travis CI, but the switch to using GitHub Actions for our CI system doesn't change the essence of the proposal, only the implementation details. Until such time as that is resolved, I don't think any additional attempts would be productive.

In fact, at least one of the code formatting checks I did implement before it became apparent the project was controversial has since been removed: https://github.com/arduino-libraries/ArduinoIoTCloud/pull/91

That said, I think it would be feasible to add a compilation test and spell check (though I am not the one who can make a final decision on that). You can see the current system for this here: https://github.com/arduino-libraries/Arduino_LSM6DS3/tree/master/.github/workflows

The only change on that I would request is to fix the indentation of the .yml files because the 1 space initial indent makes the files really annoying to work with.

per1234 avatar Mar 08 '20 02:03 per1234

Thanks for the feedback and for pointing me to the ongoing discussions.

I can certainly add those workflow .yml files with 2 space indentation, which seems like the standard here. I will wait to do that for once we can get an extra set of eyes / thoughts on this.

nnaka avatar Mar 08 '20 15:03 nnaka

As I brought up in https://github.com/arduino-libraries/Mouse/pull/13#issuecomment-598643770:

One thing to note is that these sketches already come bundled with the Arduino IDE (and Arduino Web Editor) under File > Examples > 09.USB > Keyboard.

It does make sense to bundle the examples with the library since the IDE bundled examples are not available to arduino-cli and Arduino Pro IDE users. I don't like the idea of having duplicate code to maintain, but it also could be problematic to remove the built-in sketches since there are likely tutorials that point people to that menu path. I suppose we could replace the content of the built in sketches with a comment like:

// This example has been moved to File > Examples > Keyboard > KeyboardLogout

(should be adapted to make sense for Arduino Web Editor users also)

per1234 avatar Mar 14 '20 10:03 per1234

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


nnaka1 seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Apr 09 '21 13:04 CLAassistant