Forum Archive

Haptic feedback?

shinyformica

Does pythonista come with a module for accessing the haptic feedback/vibration abilities of iOS? Something akin to the motion or sound modules, but for causing vibrations?

I'm not seeing anything...but before I delve into objective-c bridging to the UIFeedbackGenerator API, I thought I'd ask.

ccc

site:forum.omz-software.com Haptic

https://forum.omz-software.com/topic/3647/accessing-the-taptic-engine

from objc_util import ObjCClass

def taptic(n: int = 2): -> None:
    ObjCClass('UIDevice').new()._tapticEngine().actuateFeedback_(n)
shinyformica

So no python-native library, but that'll do nicely.
Love it, thanks!