Skip to content

Commit

Permalink
Fix E key event handling in CardBrowser
Browse files Browse the repository at this point in the history
The previous code was showing the edit note screen every time the
E key was pressed, this was changed to only handle the E key event
as a shortcut only if the searchbox isn't currently available(
isIconified returning true).
  • Loading branch information
lukstbit authored and BrayanDSO committed Aug 31, 2024
1 parent 7f78347 commit 83def3f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion AnkiDroid/src/main/java/com/ichi2/anki/CardBrowser.kt
Original file line number Diff line number Diff line change
Expand Up @@ -656,9 +656,15 @@ open class CardBrowser :
Timber.i("Ctrl+E: Add Note")
launchCatchingTask { addNoteFromCardBrowser() }
return true
} else {
} else if (searchView?.isIconified == true) {
Timber.i("E: Edit note")
// search box is not available so treat the event as a shortcut
openNoteEditorForCurrentlySelectedNote()
return true
} else {
Timber.i("E: Character added")
// search box might be available and receiving input so treat this as usual text
return false
}
}
KeyEvent.KEYCODE_D -> {
Expand Down

0 comments on commit 83def3f

Please sign in to comment.