Get Touch Events from iOS keyboard trackpad mode

Hello,

As of iOS 17, the keyboard app runs in a different process. I was wondering if there is a way to access the UIView of the keyboard app or if there is a way to subscribe to touch events done on the keyboard (especially during the trackpad mode).

By trackpad mode I mean when the user long presses on space and then can move in the keyboard area (that turns into a trackpad) to move the caret in a text.

Either Objective C or SwiftUI is fine.

Thanks!

Answered by DTS Engineer in 788534022

On iOS, there is no API for an app to subscribe the touch events on the system-provided keyboard. That is as-designed to protect the user's privacy.

Accepted Answer

On iOS, there is no API for an app to subscribe the touch events on the system-provided keyboard. That is as-designed to protect the user's privacy.

Hello,

Thank you for your answer! We were expecting this, just wanted to make sure that we're not missing anything.

I would have another question if possible. Is there a way to get the position of the caret while the user uses space bar navigation? And by the position I mean the position in an app or in a frame?

Thank you!

Yes, you can create a subclass of your text input view (UITextView or UITextField) and override the following UITextInput methods to get notified when a person long presses the space button and move the cursor:

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

Get Touch Events from iOS keyboard trackpad mode
 
 
Q