Skip to content

Commit

Permalink
按键锁定改回以前逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
losehu committed Dec 3, 2023
1 parent 57f77ec commit 8d67ff0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 23 deletions.
27 changes: 12 additions & 15 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 4 additions & 8 deletions app/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -1786,15 +1786,11 @@ static void ProcessKey(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
// KEY_MENU has a special treatment here, because we want to pass hold event to ACTION_Handle
// but we don't want it to complain when initial press happens
// we want to react on realese instead
else if ( // pass side buttons
!(Key == KEY_SIDE1 && !bKeyHeld)) // pass KEY_MENU held
else if (Key != KEY_SIDE1 && Key != KEY_SIDE2 && // pass side buttons
!(Key == KEY_MENU && bKeyHeld)) // pass KEY_MENU held
{
// if (!(Key == KEY_SIDE1&&bKeyHeld)&&(!bKeyPressed || (Key == KEY_SIDE1 && bKeyPressed)) && // prevent released or held, prevent KEY_MENU pressed
// !(Key == KEY_SIDE1 && !bKeyPressed)) // pass KEY_MENU released
// return;
if (!(Key == KEY_SIDE1) && !(bKeyPressed != 0))

// if (Key == KEY_SIDE1 == 0 && !bKeyPressed != 0) // pass KEY_MENU released
if ((!bKeyPressed || bKeyHeld || (Key == KEY_MENU && bKeyPressed)) && // prevent released or held, prevent KEY_MENU pressed
!(Key == KEY_MENU && !bKeyPressed)) // pass KEY_MENU released
return;

// keypad is locked, tell the user
Expand Down

0 comments on commit 8d67ff0

Please sign in to comment.