Skip to content

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

Merged
merged 4 commits into from
Dec 22, 2024

Conversation

MOldtime
Copy link
Contributor

@MOldtime MOldtime commented Nov 29, 2024

实现该issue #464
增加:长按删除时、滑动删除时、空格移动光标时的震动

@rocka
Copy link
Member

rocka commented Nov 29, 2024

考虑到并不是所有人都喜欢这个功能,需要加个开关,建议默认关闭

@MOldtime
Copy link
Contributor Author

已添加了开关,但是这个不太好命名,如果可以的话,希望得到更好的建议

@PRO-2684
Copy link

PRO-2684 commented Dec 1, 2024

已添加了开关,但是这个不太好命名,如果可以的话,希望得到更好的建议

  • Continuous Vibration
  • Vibrate on Each Deletion

@MOldtime
Copy link
Contributor Author

MOldtime commented Dec 1, 2024

已添加了开关,但是这个不太好命名,如果可以的话,希望得到更好的建议

* Continuous Vibration

* Vibrate on Each Deletion

第一个看起来不错。
除了长按删除时的震动,还有滑动删除时 和 空格移动光标时的震动,不过只做了一个开关来控制
或许我应该增加设置项使其更好命名

@keta1
Copy link
Contributor

keta1 commented Dec 10, 2024

已添加了开关,但是这个不太好命名,如果可以的话,希望得到更好的建议

  • Continuous Vibration
  • Vibrate on Each Deletion

Haptic Feedback

@rocka
Copy link
Member

rocka commented Dec 10, 2024

我想到一个比较合适的名字: Haptic feedback on key repeat

但是直译到中文“按键重复时振动”好像不太通顺

@MOldtime
Copy link
Contributor Author

已修改默认名为:Haptic feedback on key repeat

@MOldtime
Copy link
Contributor Author

MOldtime commented Dec 11, 2024

增加了:输入框没有字时停止连续震动
不知道实现方式有没有问题

Copy link
Member

@rocka rocka left a 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 的时候判断就行了

另外长按退格键连续删除的振动反馈都有了,顺便给左划退格键选择删除也加上吧

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
}
}

@MOldtime MOldtime force-pushed the vibration branch 3 times, most recently from 6b1c09b to f97fbc5 Compare December 17, 2024 01:45
Copy link
Member

@rocka rocka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 😎

@rocka rocka changed the title Add some vibration Add option "Haptic feedback on key repeat" Dec 20, 2024
@rocka rocka merged commit 3529610 into fcitx5-android:master Dec 22, 2024
6 checks passed
@MOldtime MOldtime deleted the vibration branch December 23, 2024 00:45
mokapsing pushed a commit to mokapsing/fcitx5-android that referenced this pull request Dec 23, 2024
wxyzh pushed a commit to wxyzh/fcitx5-android that referenced this pull request Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy