Skip to content

Commit 83f7751

Browse files
committed
Documented, improved and LAYOUT_FRENCH_BELGIAN fixed :-)
1 parent 33845a5 commit 83f7751

File tree

3 files changed

+103
-95
lines changed

3 files changed

+103
-95
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Available as Arduino Board Manager entry "Digistump AVR Boards" using the Board
1919
- Included most [pull requests](https://github.com/digistump/DigistumpArduino/pulls) done after the 1.6.7 release like `recipe.output.tmp_file={build.project_name}.hex` in *platform.txt* and EEPROM library.
2020
- Added recipe to update booltloader by Arduino IDE.
2121
- Removed the non trusted post_install.bat since Arduino code states: `// Set main and bundled indexes as trusted` => all others are untrusted.
22-
- Extended `DigisparkKeyboard` library with 22 keyboard layouts from [Teensyduino Core Library](https://github.com/PaulStoffregen/cores/blob/master/teensy/keylayouts.h), fixed bugs and improved it.
22+
- Extended `DigisparkKeyboard` library with 22 keyboard layouts from [Teensyduino Core Library](https://github.com/PaulStoffregen/cores/blob/master/teensy/keylayouts.h), fixed bugs, **documented** and improved it. [Here](https://github.com/ArminJo/DigistumpArduino/blob/542aac12e56a1818af32b303c5709c655a12d98d/digistump-avr/libraries/DigisparkKeyboard/keylayouts.h#L80) it is documented how the mapping works, so now you can fix wrong mappings by your own (but please give me feedback to include the fix).
2323

2424
# Installation
2525
To get all the benefits, just replace the old Digispark board URL **http://digistump.com/package_digistump_index.json** (e.g. in Arduino *File/Preferences*) by the new **https://raw.githubusercontent.com/ArminJo/DigistumpArduino/master/package_digistump_index.json** and install the **Digistump AVR Boards** version **1.6.8**.

digistump-avr/libraries/DigisparkKeyboard/DigiKeyboard.h

+7-5
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,15 @@ class DigiKeyboardDevice: public Print {
147147
return modifier;
148148
}
149149

150+
/*
151+
* Mask keycodes to ascii subset (+ a few F keys)
152+
*/
150153
uint8_t keycode_to_key(KEYCODE_TYPE keycode) {
151-
uint8_t key = keycode & 0x3F;
152-
#ifdef KEY_NON_US_100
153-
if (key == KEY_NON_US_100) {
154-
key = 100;
154+
uint8_t key = keycode;
155+
// the only valid ASCII code > 63
156+
if (keycode != KEY_NON_US_BS) {
157+
key = key & 0x3F;
155158
}
156-
#endif
157159
return key;
158160
}
159161

0 commit comments

Comments
 (0)