Skip to content

Commit

Permalink
fix: don't show warning on numpad
Browse files Browse the repository at this point in the history
  • Loading branch information
SanjaySargam committed Nov 28, 2024
1 parent 83b75bf commit 88caaa6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion AnkiDroid/src/main/java/com/ichi2/anki/AnkiActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ open class AnkiActivity : AppCompatActivity, SimpleMessageDialogListener, Shortc
val done = super.onKeyUp(keyCode, event)

// Show snackbar only if the current activity have shortcuts, a modifier key is pressed and the keyCode is an unmapped alphabet key
if (!done && shortcuts != null && (event.isCtrlPressed || event.isAltPressed || event.isMetaPressed) && (keyCode in KeyEvent.KEYCODE_A..KeyEvent.KEYCODE_Z) || (keyCode in KeyEvent.KEYCODE_NUMPAD_0..KeyEvent.KEYCODE_NUMPAD_9)) {
if (!done && shortcuts != null && ((event.isCtrlPressed || event.isAltPressed || event.isMetaPressed) && (keyCode in KeyEvent.KEYCODE_A..KeyEvent.KEYCODE_Z) || (keyCode in KeyEvent.KEYCODE_NUMPAD_0..KeyEvent.KEYCODE_NUMPAD_9))) {
showSnackbar(R.string.show_shortcuts_message, Snackbar.LENGTH_SHORT)
return true
}
Expand Down

0 comments on commit 88caaa6

Please sign in to comment.