Skip to content

Commit

Permalink
Fix some errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ernesto-xload committed Sep 26, 2017
1 parent 0a0e2e4 commit b654f02
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/Keyboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,13 @@ size_t Keyboard_::press(uint8_t k)
uint8_t i;

if(k>=0xB0 && k<=0xDA){ //it's a non-printing key
k = k - 136;
if(k>=0xB5 && k<=0xBE){ //0xB5-0xBE reserved for special non printing keys asigned manually
if(k==0xB5) k=0x65; //0xB5 ==> 0x76 (MENU key)
if(k==0xB6) k=0x46; //0xB6 ==> 0x46 (PRINT Screen key)
}
else{
k = k - 136;
}
}
else {
if(k>=0x80 && k<=0x87){ //it's a modifier
Expand Down Expand Up @@ -474,7 +480,13 @@ size_t Keyboard_::release(uint8_t k)
uint8_t i;

if(k>=0xB0 && k<=0xDA){ //it's a non-printing key
k = k - 136;
if(k>=0xB5 && k<=0xBE){ //0xB5-0xBE reserved for special non printing keys asigned manually
if(k==0xB5) k=0x65; //0xB5 ==> 0x76 (MENU key)
if(k==0xB6) k=0x46; //0xB6 ==> 0x46 (PRINT Scr key)
}
else{
k = k - 136;
}
}
else {
if(k>=0x80 && k<=0x87){ //it's a modifier
Expand Down
4 changes: 4 additions & 0 deletions src/Keyboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ Only es_es and en_us are full-tested.
#define KEY_F11 0xCC
#define KEY_F12 0xCD

//0xB5-0xBE reserved for special non printing keys
#define KEY_MENU 0xB5
#define KEY_PRINTSCREEN 0xB6

// Low level key report: up to 6 keys and shift, ctrl etc at once
typedef struct
{
Expand Down

0 comments on commit b654f02

Please sign in to comment.