Skip to content

Conversation

@ZiemlichUndead
Copy link

I added a line that triggers the default haptic and audio feedback when the cursor is getting moved by swiping over the spacebar.
If keypress sound is enabled the sound might get spammed a bit.

The implementation works well for me like this but I didnt fully understand the method I modified so maybe this doesnt make sense in every case.

Issue 381 also requested this.

Steffen.S added 2 commits August 6, 2024 01:58
Added methods to customize for cursor haptic feedback using TEXT_HANDLE_MOVE and CLOCK_TICK (API <27)
@ZiemlichUndead
Copy link
Author

I have now added methods to make the call using TEXT_HANDLE_MOVE and remove audiofeedback.
TEXT_HANDLE_MOVE isnt available in API <27 so I used CLOCK_TICK in that case which seemed similar to me.

viewToPerformHapticFeedbackOn.performHapticFeedback(
HapticFeedbackConstants.TEXT_HANDLE_MOVE,
HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING);
}else {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
}else {
} else {

@Helium314
Copy link
Owner

Does this work for everyone except me?
It seems like a bunch of HapticFeedbackConstants like CLOCK_TICK or TEXT_HANDLE_MOVE don't actually trigger anything. Others like KEYBOARD_TAP are too strong, as already discussed. Specifying e.g. vibrate(10) works though.
Using Android 10 / LineageOS 17, Samsung A3 2017.

@devycarol
Copy link
Contributor

I actually wrote some haptic mods a while ago for my homebrew. Those are newer API constants, so they do nothing on newer versions. I believe they have IDE warnings because of that.

I've not looked at the code in a while, but there should probably be a central place haptics handling that addresses all the version differences and stuff.

@Helium314
Copy link
Owner

but there should probably be a central place haptics handling that addresses all the version differences and stuff.

Actually there were a few Compat files for various things. I removed a bunch, as we don't need to deal with Android before 5 any mre, but I neglected adding new ones when it would have been useful.
But anyway, I agree putting stuff that deals with API differences should be put in a separate file (or folder).

@Helium314 Helium314 mentioned this pull request Oct 25, 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