Skip to content

Commit 0ec9288

Browse files
facchinmcmaglie
authored andcommitted
rework HID-based libraries and add Due fallback
1 parent d1a9181 commit 0ec9288

File tree

5 files changed

+64
-8
lines changed

5 files changed

+64
-8
lines changed

README.adoc

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
= Keyboard Library for Arduino =
2+
3+
This library allows an Arduino board with USB capabilites to act as a Keyboard.
4+
Being based on HID library you need to include "HID.h" in your sketch.
5+
6+
For more information about this library please visit us at
7+
http://www.arduino.cc/en/Reference/Keyboard
8+
9+
== License ==
10+
11+
Copyright (c) Arduino LLC. All right reserved.
12+
13+
This library is free software; you can redistribute it and/or
14+
modify it under the terms of the GNU Lesser General Public
15+
License as published by the Free Software Foundation; either
16+
version 2.1 of the License, or (at your option) any later version.
17+
18+
This library is distributed in the hope that it will be useful,
19+
but WITHOUT ANY WARRANTY; without even the implied warranty of
20+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21+
Lesser General Public License for more details.
22+
23+
You should have received a copy of the GNU Lesser General Public
24+
License along with this library; if not, write to the Free Software
25+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

keywords.txt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#######################################
2+
# Syntax Coloring Map For Keyboard
3+
#######################################
4+
5+
#######################################
6+
# Datatypes (KEYWORD1)
7+
#######################################
8+
9+
Keyboard KEYWORD1
10+
11+
#######################################
12+
# Methods and Functions (KEYWORD2)
13+
#######################################
14+
15+
begin KEYWORD2
16+
write KEYWORD2
17+
press KEYWORD2
18+
release KEYWORD2
19+
releaseAll KEYWORD2
20+
21+
#######################################
22+
# Constants (LITERAL1)
23+
#######################################
24+

library.properties

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name=Keyboard
2+
version=1.0.0
3+
author=Arduino
4+
maintainer=Arduino <[email protected]>
5+
sentence=Allows an Arduino board with USB capabilites to act as a Keyboard. For Leonardo/Micro only
6+
paragraph=This library plugs on the HID library. It can be used with or without other HID-based libraries (Mouse, Gamepad etc)
7+
category=USB
8+
url=http://www.arduino.cc/en/Reference/Keyboard
9+
architectures=*

Keyboard.cpp renamed to src/Keyboard.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2020
*/
2121

22-
#if 1
23-
2422
#include "Keyboard.h"
2523

24+
#if defined(_USING_HID)
25+
2626
//================================================================================
2727
//================================================================================
2828
// Keyboard

Keyboard.h renamed to src/Keyboard.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,13 @@
2222
#ifndef KEYBOARD_h
2323
#define KEYBOARD_h
2424

25-
#if 0 //defined(_USING_HID)
26-
27-
#error "Can only attach one submodule to HID module"
25+
#include "HID.h"
2826

29-
#else
27+
#if !defined(_USING_HID)
3028

31-
#define _USING_HID
29+
#warning "Using legacy HID core (non pluggable)"
3230

33-
#include "HID.h"
31+
#else
3432

3533
//================================================================================
3634
//================================================================================

0 commit comments

Comments
 (0)