diff --git a/src/ImprovedKeyboard.cpp b/src/ImprovedKeyboard.cpp index 74f9355..1a42027 100644 --- a/src/ImprovedKeyboard.cpp +++ b/src/ImprovedKeyboard.cpp @@ -85,10 +85,6 @@ void Keyboard_::sendReport(KeyReport* keys) HID.SendReport(HID_REPORTID_KEYBOARD,keys,sizeof(KeyReport)); } -uint8_t Keyboard_::getKeycode(uint8_t k){ - return pgm_read_byte(_asciimap + k); -} - // press() adds the specified key (printing, non-printing, or modifier) // to the persistent key report and sends the report. Because of the way // USB HID works, the host acts like the key remains pressed until we @@ -102,7 +98,7 @@ size_t Keyboard_::press(uint8_t k) _keyReport.modifiers |= (1<<(k-128)); k = 0; } else { // it's a printing key - k = getKeycode(k); + k = pgm_read_byte(_asciimap + k); if (!k) { setWriteError(); return 0; @@ -146,7 +142,7 @@ size_t Keyboard_::release(uint8_t k) _keyReport.modifiers &= ~(1<<(k-128)); k = 0; } else { // it's a printing key - k = getKeycode(k); + k = pgm_read_byte(_asciimap + k); if (!k) { return 0; } diff --git a/src/ImprovedKeyboard.h b/src/ImprovedKeyboard.h index 7fb1aba..63fda4b 100644 --- a/src/ImprovedKeyboard.h +++ b/src/ImprovedKeyboard.h @@ -51,7 +51,6 @@ class Keyboard_ : public Print private: KeyReport _keyReport; void sendReport(KeyReport* keys); - uint8_t getKeycode(uint8_t k) __attribute__((weak)); public: Keyboard_(void); void begin(void);