Title: Mapbox Geocoder integration with on-screen keyboard
Tags: mapbox;mapbox-gl-js
Question: I tried out this mapbox geocoding example:
https://docs.mapbox.com/mapbox-gl-js/example/mapbox-gl-geocoder/
in my application.
Now, I am trying to do the same thing, but instead of using a physical keyboard, I am trying to use on-screen keyboard like:
https://virtual-keyboard.js.org/
But at the moment, the inputs from the virtual-keyboard is not triggering the mapbox geocoder. How can I link the two components?

Here is the accepted answer: As indicated in the implementation of the keyevent function here in the mapbox/mapbox-gl-geocoder source code, the geocoder responds to keydown events, which are fired when a key is pressed.
The documentation for the virtual keyboard you linked includes an onKeyPress method to which you can pass a callback function to be executed when a key is pressed on the virtual keyboard. You can implement a function to simulate a keydown event (as described in this Stack Overflow post) equivalent to the last character from getInput. This should have the effect of triggering the geocoder as through an actual key was pressed.
Comment for this answer: Thank you Adriana. I used the method from the link below to generate the keydown event.
https://plainjs.com/javascript/events/trigger-an-event-11/


{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2020:00:03/11/20', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<mapbox><mapbox-gl-js>', 'Title': 'Mapbox Geocoder integration with on-screen keyboard', 'ViewCount': 172, 'id': 60631294, 'user_AboutMe': None, 'user_AccountId': 4790260.0, 'user_DisplayName': 'spockshr', 'user_Reputation': 342.0, 'user_Views': 43.0, 'user_id': 9018273.0}}