Hello
I am implementing an app with a customer keyboard, I need to dispatch a keyboard event for a xamarin IOS app, The app is cross platform and with the following code I can dispatch the event on xamarin Android.
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 get the equivalent for xamarin IOS
Thanks
Answers
It seems like you want to detect keyboard press on webview , please check this :https://stackoverflow.com/a/23891845/8187800
No, I do not want to detect keyboard press. I need to simulate a keyboard key pressed. When a button from my view is pressed I want to fire a keyboard event for a predefined key. For example a Letter like "a" of a number "3".
Refer https://stackoverflow.com/a/37503470/8187800.
You could use UIApplication.sendEvent(_:) to dispatches an event to the appropriate responder objects in the app.
However , it's not recommend to use this in production.
Do you have an example on how to implement something like that? I was not able to find one.
Thanks
Check https://stackoverflow.com/a/19931740/8187800