Remove the unused prevKeyStates argument from hasKeyPressed()
This commit is contained in:
+3
-3
@@ -56,7 +56,7 @@ static bool hasKeyPressed(const uint8_t *prevKeyStates, const uint8_t *currKeySt
|
|||||||
return (!prevKeyStates[keyId]) && currKeyStates[keyId];
|
return (!prevKeyStates[keyId]) && currKeyStates[keyId];
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool isKeyPressed(const uint8_t *prevKeyStates, const uint8_t *currKeyStates, uint8_t keyId)
|
static bool isKeyPressed(const uint8_t *currKeyStates, uint8_t keyId)
|
||||||
{
|
{
|
||||||
return currKeyStates[keyId];
|
return currKeyStates[keyId];
|
||||||
}
|
}
|
||||||
@@ -69,7 +69,7 @@ static bool hasKeyReleased(const uint8_t *prevKeyStates, const uint8_t *currKeyS
|
|||||||
static bool handleKey(key_action_t key, int scancodeIdx, usb_keyboard_report_t *report, const uint8_t *prevKeyStates, const uint8_t *currKeyStates, uint8_t keyId) {
|
static bool handleKey(key_action_t key, int scancodeIdx, usb_keyboard_report_t *report, const uint8_t *prevKeyStates, const uint8_t *currKeyStates, uint8_t keyId) {
|
||||||
switch (key.type) {
|
switch (key.type) {
|
||||||
case KEY_ACTION_KEYSTROKE:
|
case KEY_ACTION_KEYSTROKE:
|
||||||
if (isKeyPressed(prevKeyStates, currKeyStates, keyId)) {
|
if (isKeyPressed(currKeyStates, keyId)) {
|
||||||
return pressKey(key, scancodeIdx, report);
|
return pressKey(key, scancodeIdx, report);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -96,7 +96,7 @@ static bool wasPreviousMouseActionWheelAction = false;
|
|||||||
|
|
||||||
void HandleMouseKey(usb_mouse_report_t *report, key_action_t key, const uint8_t *prevKeyStates, const uint8_t *currKeyStates, uint8_t keyId)
|
void HandleMouseKey(usb_mouse_report_t *report, key_action_t key, const uint8_t *prevKeyStates, const uint8_t *currKeyStates, uint8_t keyId)
|
||||||
{
|
{
|
||||||
if (!isKeyPressed(prevKeyStates, currKeyStates, keyId)) {
|
if (!isKeyPressed(currKeyStates, keyId)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user