Autocomplete: trigger with onscreen keyboard

I am attempting to implement an on-screen keyboard using the following library: https://github.com/Mottie/Keyboard

This works for all fields except for the search form which has algolia’s autocomplete enabled.

Expected behaviour
Using the on screen keyboard the search field should be filled in and the suggestions container should appear.

Current behaviour
When using the onscreen keyboard (clicking on the keys) the autocomplete is not triggered. However it does still work when using the physical keyboard.

Attempts to resolve this problem

  • Created a listener for the keyboard change event and then setting the search field’s value programattically.
  • In the same event listener I also attempted to trigger keypress/keydown/keyup events on the search field.
  • Attempted to call $(el).autocomplete(‘val’, onscreenKeyboardValue), but this results in an error "cannot call methods on autocomplete prior to initialization; attempted to call method ‘val’
    "

Notes
We are currently running Magento (2.1.X) and the algolia search plugin (1.0.10).