-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathLocaleDigiKeyboard.h
More file actions
29 lines (25 loc) · 863 Bytes
/
LocaleDigiKeyboard.h
File metadata and controls
29 lines (25 loc) · 863 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include "DigiKeyboard.h"
#ifndef LOCALEDIGIKEYBOARD_H
#define LOCALEDIGIKEYBOARD_H
#define SHIFT (1<<9)
#define ALT (1<<14)
// PASTE HERE SOME LOCALE FILE CONTENT. Ex.: en_UK.lang
class LocaleDigiKeyboardDevice : public DigiKeyboardDevice{
public:
size_t write(uint8_t chr) {
unsigned int temp = pgm_read_word_near(_ascii_custom_map + chr);
unsigned char low = temp & 0xFF;
unsigned char high = (temp >> 8) & 0xFF;
sendKeyStroke(low,high);
return 1;
}
void sendKeyReport(uchar *array,const unsigned int size){
while (!usbInterruptIsReady()) {
usbPoll();
_delay_ms(5);
}
usbSetInterrupt(array, size);
}
};
LocaleDigiKeyboardDevice LocaleDigiKeyboard = LocaleDigiKeyboardDevice();
#endif //LOCALEDIGIKEYBOARD_H