Skip to content

Commit

Permalink
#91: allow set up of all keys at once
Browse files Browse the repository at this point in the history
  • Loading branch information
alvieboy committed May 22, 2021
1 parent 2839281 commit 5a669e8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions esp32/main/keyboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,16 @@ void keyboard__release(uint8_t key)
keyboard__update();
}

/**
* \ingroup keyboard
* \brief Set all keys on keyboard.
*/
void keyboard__set(uint64_t k)
{
keys = k;
keyboard__update();
}

static struct {
const char *name;
uint8_t value;
Expand Down
1 change: 1 addition & 0 deletions esp32/main/keyboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
void keyboard__init(void);
void keyboard__press(uint8_t key);
void keyboard__release(uint8_t key);
void keyboard__set(uint64_t k);
uint8_t keyboard__get_key_by_name(const char *name);
const char *keyboard__get_name_by_key(const uint8_t key);

Expand Down

0 comments on commit 5a669e8

Please sign in to comment.