0

I am implementing an app with a customer keyboard, The keyboard was created with all buttons where there is a button for every key, when these buttons are pressed the keyboard event is fired. The app is cross platform and with the following code I can dispatch the event on Xamarin Android from a webview on a custom renderer.

webView.DispatchKeyEvent(new KeyEvent(0, 0, KeyEventActions.Down, KeyEvent.KeyCodeFromString(digit), 0, MetaKeyStates.ShiftLeftOn | MetaKeyStates.CtrlOn));
webView.DispatchKeyEvent(new KeyEvent(0, 0, KeyEventActions.Up, KeyEvent.KeyCodeFromString(digit), 0, MetaKeyStates.ShiftLeftOn | MetaKeyStates.CtrlOn));

I need to dispatch a keyboard event for a Xamarin IOS is a similar fashion as in Android. I need to get the equivalent code in IOS to fire a keyboard event when a button is pressed.

Thanks

  • 1
    You could use `UIApplication.sendEvent()` to dispatches an event to the appropriate responder objects in the app.refer to [here](https://stackoverflow.com/a/19931740/8187800) – Leo Zhu Nov 19 '19 at 09:04
  • Thanks for your message, I looked into this option but could not find a example on how to implement ut. Do you have more info you can provide on this approach? Thanks – Gabriel Duchateau Nov 20 '19 at 20:00

0 Answers0