-
Notifications
You must be signed in to change notification settings - Fork 217
Add option "Haptic feedback on key repeat" #626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
考虑到并不是所有人都喜欢这个功能,需要加个开关,建议默认关闭 |
已添加了开关,但是这个不太好命名,如果可以的话,希望得到更好的建议 |
|
第一个看起来不错。 |
Haptic Feedback |
我想到一个比较合适的名字: Haptic feedback on key repeat 但是直译到中文“按键重复时振动”好像不太通顺 |
已修改默认名为: |
增加了:输入框没有字时停止连续震动 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TLDR: 不建议用 selection range 作为 haptic feedback 的判断条件,直接在 onAction 的时候判断就行了
另外长按退格键连续删除的振动反馈都有了,顺便给左划退格键选择删除也加上吧
fcitx5-android/app/src/main/java/org/fcitx/fcitx5/android/input/keyboard/BaseKeyboard.kt
Lines 187 to 202 in 78cfe81
onGestureListener = OnGestureListener { _, event -> | |
when (event.type) { | |
GestureType.Move -> { | |
val count = event.countX | |
if (count != 0) { | |
onAction(KeyAction.MoveSelectionAction(count)) | |
true | |
} else false | |
} | |
GestureType.Up -> { | |
onAction(KeyAction.DeleteSelectionAction(event.totalX)) | |
false | |
} | |
else -> false | |
} | |
} |
app/src/main/java/org/fcitx/fcitx5/android/data/prefs/AppPrefs.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/fcitx/fcitx5/android/input/FcitxInputMethodService.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/fcitx/fcitx5/android/input/FcitxInputMethodService.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/fcitx/fcitx5/android/input/keyboard/BaseKeyboard.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/fcitx/fcitx5/android/input/keyboard/BaseKeyboard.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/fcitx/fcitx5/android/input/keyboard/BaseKeyboard.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/fcitx/fcitx5/android/input/keyboard/BaseKeyboard.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/fcitx/fcitx5/android/input/keyboard/BaseKeyboard.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/fcitx/fcitx5/android/input/keyboard/BaseKeyboard.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/fcitx/fcitx5/android/input/keyboard/KeyboardWindow.kt
Outdated
Show resolved
Hide resolved
6b1c09b
to
f97fbc5
Compare
app/src/main/java/org/fcitx/fcitx5/android/input/keyboard/BaseKeyboard.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 😎
Co-authored-by: Rocka <i@rocka.me>
Co-authored-by: Rocka <i@rocka.me>
实现该issue #464
增加:长按删除时、滑动删除时、空格移动光标时的震动