Skip to content

Commit

Permalink
重构:优化快捷键代码
Browse files Browse the repository at this point in the history
  • Loading branch information
tangshimin committed Mar 3, 2024
1 parent b963ded commit 8e3c802
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/jvmMain/kotlin/ui/WordScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -642,11 +642,13 @@ fun MainContent(
true
}
(it.isCtrlPressed && it.key == Key.I && it.type == KeyEventType.KeyUp) -> {
scope.launch {
bookmarkClick()
}
showBookmark = true
true
if(!it.isShiftPressed){
scope.launch {
bookmarkClick()
}
showBookmark = true
true
}else false
}
(it.isCtrlPressed && it.key == Key.Y && it.type == KeyEventType.KeyUp) -> {
if(wordScreenState.vocabulary.name == "FamiliarVocabulary"){
Expand Down Expand Up @@ -1293,10 +1295,6 @@ fun MainContent(
}else false

}
(it.isCtrlPressed && it.isShiftPressed && it.key == Key.I && it.type == KeyEventType.KeyUp) -> {
// 消耗快捷键,消耗之后,就不会触发 Ctrl + I 了
true
}
(it.isCtrlPressed && it.isShiftPressed && it.key == Key.K && it.type == KeyEventType.KeyUp) -> {
jumpToCaptions()
true
Expand Down

0 comments on commit 8e3c802

Please sign in to comment.