-
Notifications
You must be signed in to change notification settings - Fork 121
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
[Capacitor] Haptic feedback #2392
Comments
@raineorshine I've been looking into this issue for a bit now and I have a few questions we can discuss about it. The majority of these Haptrics changes involve impact (light) and I found that we can make it uniform by adding it during the fastClick.ts file which is used throughout the app. Is this something you are interested in? It adds a light vibration at almost every 'button action' throughout the app, including links, when you tap the screen anywhere to scroll when you open the hamburger menu, and in most other places. The selectionStart and selectionEnd probably can't be handled in a generic way like this, but its still nice to find this. Tell me what you think. |
Yes, agreed! The only one that I'm unsure of is "when you tap the screen anywhere to scroll". Do you mean when you tap the scroll zone on the right? We can easily add an option to |
@raineorshine, I added selectionChanged to the MultiGesture feature when a user swipes the canvas, but I saw that it triggers each time the canvas is updated. Was this what you considered when you listed it on this ticket? Or were you thinking it would be just a selectionStart and selectionEnd event after the user finishes drawing? |
The gesture should trigger haptics at the start, at the end, and once for each swipe. So →↓→ would trigger: → selectionStart |
@raineorshine Got it. I got that worked out in the new pr. I had another question about the drag-and-drop feature. I tried adding Haptics to it, but I can't seem to replicate the drag and drop feature. Is there a bug here that I don't know about? Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-11-25.at.11.56.44.mp4 |
Ah yes, drag-and-drop currently has some issues that were introduced in #950. This is being tracked in #2474. The developer responsible is currently held up with some other work. We will have to wait till that is fixed before we can add drag-and-drop haptics. I won't hold up the milestone if #2474 is still stalled. |
Alright, thanks for the quick response. |
Use the Capacitor Haptics API to provide physical feedback to the user.
https://capacitorjs.com/docs/apis/haptics
Haptic options:
Haptic requirements:
selectionStart
selectionChanged
selectionEnd
impact
(light)notification
(warning)notification
(warning)notification
(warning)impact
? Like old iPod or Nest wheel.selectionStart
selectionStart
selectionChanged
selectionEnd
notification
(warning)impact
(light)impact
(light)impact
(light)Plan for 1–2 iterations of tweaks once initial implementation can be physically tested.
The text was updated successfully, but these errors were encountered: