KeyboardKit / KeyboardKitPro

KeyboardKit Pro helps you create custom keyboards for iOS and iPadOS.
https://keyboardkit.com
Other
103 stars 8 forks source link

How to add drag gesture for space button? #12

Open DaniilShmoylove opened 3 weeks ago

DaniilShmoylove commented 3 weeks ago

I'm want to add horizontal swipe gesture for space button on the keyboard. I know how to implement this functionality using StandardActionHandler, but it doesn’t work correctly, because i want to set a flag so the user only switches once per press.

Previously, I opened an issue with a similar problem, but it was closed: https://github.com/KeyboardKit/KeyboardKit/issues/708#issue-2246168273

danielsaidi commented 2 weeks ago

Hi @DaniilShmoylove

You can set a flag in a custom action handler (or anywhere else) on press, then reset that flag on release. That way, your custom action would only trigger once.

You can check out the space drag to move the input cursor gesture for inspiration, although that keeps triggering for every certain number of points moved.