-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Configure for latest Arduino Library Manager versions
Tidy up conditionals for adding platforms Simplify examples
- Loading branch information
Showing
7 changed files
with
45 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
name=PS2KeyMap | ||
version=1.0.2 | ||
version=1.0.4 | ||
author=Paul Carpenter <[email protected]> | ||
maintainer=Paul Carpenter <[email protected]> | ||
sentence=PS2 keyboard codes from PS2KeyAdvanced to UTF-8 for any Latin language keyboard. | ||
|
@@ -8,3 +8,5 @@ category=Other | |
url=https://github.com/techpaul/PS2KeyMap.git | ||
architectures=avr,sam | ||
depends=PS2KeyAdvanced | ||
includes=PS2KeyAdvanced.h,PS2KeyMap.h | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
/* Version V1.0.2 | ||
/* Version V1.0.4 | ||
PS2KeyMap.h - PS2KeyAdvanced library | ||
Copyright (c) 2007 Free Software Foundation. All right reserved. | ||
Written by Paul Carpenter, PC Services <[email protected]> | ||
Created September 2014 | ||
Updated January 2016 - Paul Carpenter - add tested on Due and tidy ups for V1.5 Library Management | ||
January 2020 - Paul Carpenter - extend library properties for V2.2 of Arduino Library Management | ||
PRIVATE to library data and keymapping tables | ||
PRIVATE to library data and key mapping tables | ||
This library REQUIRES PS2KeyAdvanced and PS2KeyMap.h as the codes used to | ||
remap to ASCII/UTF-8 are specific to that library to match ALL keys on a keyboard | ||
|
@@ -44,19 +45,19 @@ | |
|
||
/* Standard ASCII control characters array */ | ||
/* in order of PS2_KEY_* values order is important */ | ||
#if defined(ARDUINO_ARCH_AVR) | ||
#if defined(PS2_REQUIRES_PROGMEM) | ||
const uint8_t PROGMEM _control_codes[] = { | ||
#elif defined(ARDUINO_ARCH_SAM) | ||
#else | ||
const uint8_t _control_codes[] = { | ||
#endif | ||
PS2_DELETE, PS2_ESC, PS2_BACKSPACE, | ||
PS2_TAB, PS2_ENTER, PS2_SPACE | ||
}; | ||
|
||
// convert codes based on SHIFT and not SHIFT only for base US-ASCII | ||
#if defined(ARDUINO_ARCH_AVR) | ||
#if defined(PS2_REQUIRES_PROGMEM) | ||
const uint16_t PROGMEM _US_ASCII[][ 2 ] = { | ||
#elif defined(ARDUINO_ARCH_SAM) | ||
#else | ||
const uint16_t _US_ASCII[][ 2 ] = { | ||
#endif | ||
{ PS2_SHIFT + PS2_KEY_1, '!' }, | ||
|
@@ -101,9 +102,9 @@ const uint16_t _US_ASCII[][ 2 ] = { | |
{ PS2_SHIFT + PS2_KEY_EQUAL, '+' } | ||
}; | ||
|
||
#if defined(ARDUINO_ARCH_AVR) | ||
#if defined(PS2_REQUIRES_PROGMEM) | ||
const uint16_t PROGMEM _UKmap[][ 2 ] = { | ||
#elif defined(ARDUINO_ARCH_SAM) | ||
#else | ||
const uint16_t _UKmap[][ 2 ] = { | ||
#endif | ||
{ PS2_SHIFT + '@', '"' }, | ||
|
@@ -117,9 +118,9 @@ const uint16_t _UKmap[][ 2 ] = { | |
{ PS2_SHIFT + PS2_KEY_EUROPE2, '|' }, | ||
}; | ||
#ifdef FRENCH | ||
#if defined(ARDUINO_ARCH_AVR) | ||
#if defined(PS2_REQUIRES_PROGMEM) | ||
const uint16_t PROGMEM _FRmap[][ 2 ] = { | ||
#elif defined(ARDUINO_ARCH_SAM) | ||
#else | ||
const uint16_t _FRmap[][ 2 ] = { | ||
#endif | ||
{ '`', PS2_SUPERSCRIPT_TWO }, | ||
|
@@ -209,9 +210,9 @@ const uint16_t _FRmap[][ 2 ] = { | |
}; | ||
#endif | ||
#ifdef GERMAN | ||
#if defined(ARDUINO_ARCH_AVR) | ||
#if defined(PS2_REQUIRES_PROGMEM) | ||
const uint16_t PROGMEM _DEmap[][ 2 ] = { | ||
#elif defined(ARDUINO_ARCH_SAM) | ||
#else | ||
const uint16_t _DEmap[][ 2 ] = { | ||
#endif | ||
{ '`', '^' }, | ||
|
@@ -272,9 +273,9 @@ const uint16_t _DEmap[][ 2 ] = { | |
}; | ||
#endif | ||
#ifdef SPECIAL | ||
#if defined(ARDUINO_ARCH_AVR) | ||
#if defined(PS2_REQUIRES_PROGMEM) | ||
const uint16_t PROGMEM _SpecialMap[][ 2 ] = { | ||
#elif defined(ARDUINO_ARCH_SAM) | ||
#else | ||
const uint16_t _SpecialMap[][ 2 ] = { | ||
#endif | ||
// Insert your Special mapping DIFFERENCES from US-ASCII here | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
/* Version V1.0.2 | ||
/* Version V1.0.4 | ||
PS2KeyMap.cpp - PS2KeyMap library | ||
Copyright (c) 2007 Free Software Foundation. All right reserved. | ||
Written by Paul Carpenter, PC Services <[email protected]> | ||
Created September 2014 | ||
Updated January 2016 - Paul Carpenter - add tested on Due and tidy ups for V1.5 Library Management | ||
January 2020 - Paul Carpenter - extend library properties for V2.2 of Arduino Library Management | ||
IMPORTANT WARNING | ||
|
@@ -212,11 +213,11 @@ result = data & ( PS2_ALT_GR + PS2_SHIFT + 0xFF ); | |
|
||
// scan Lookup Table (array) jumping 2 integers at a time | ||
for( idx = 0; idx < size; idx += 2 ) | ||
#if defined(ARDUINO_ARCH_AVR) | ||
#if defined(PS2_REQUIRES_PROGMEM) | ||
if( result == pgm_read_word( maparray + idx ) ) | ||
{ // second integer is the replacement value | ||
result = pgm_read_word( maparray + idx + 1 ); | ||
#elif defined(ARDUINO_ARCH_SAM) | ||
#else | ||
if( result == *( maparray + idx ) ) | ||
{ // second integer is the replacement value | ||
result = *( maparray + idx + 1 ); | ||
|
@@ -285,9 +286,9 @@ temp = code & 0xFF; | |
if( temp >= PS2_KEY_DELETE && temp <= PS2_KEY_SPACE ) | ||
{ | ||
code &= ~( PS2_FUNCTION + 0xFF ); // convert to ASCII code not function | ||
#if defined(ARDUINO_ARCH_AVR) | ||
#if defined(PS2_REQUIRES_PROGMEM) | ||
temp = pgm_read_byte( &_control_codes[ temp - PS2_KEY_DELETE ] ); | ||
#elif defined(ARDUINO_ARCH_SAM) | ||
#else | ||
temp = _control_codes[ temp - PS2_KEY_DELETE ]; | ||
#endif | ||
code |= temp; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
/* Version V1.0.2 | ||
/* Version V1.0.4 | ||
PS2KeyMap.h - PS2KeyAdvanced library | ||
Copyright (c) 2007 Free Software Foundation. All right reserved. | ||
Written by Paul Carpenter, PC Services <[email protected]> | ||
Created September 2014 | ||
Updated January 2016 - Paul Carpenter - add tested on Due and tidy ups for V1.5 Library Management | ||
January 2020 - Paul Carpenter - extend library properties for V2.2 of Arduino Library Management | ||
IMPORTANT WARNING | ||
|