I am trying to write a simple, general purpose ‘select one of these options’ modal. The modal is implemented using custom HTML/CSS and
Ideally, I call the modal with a list of strings (in code). The modal starts up, and shows the strings to the user as individual list items. The user then uses their arrow keys + enter to select an item. A callback is invoked to deliver the results to a predefined handler.
Problem: I cannot seem to ‘get notified’ when the keys are pressed. I have tried many different methods but none work.
How can I get a method called when these keys are pressed in the modal?
Current code (keypresses not working): https://github.com/twitchyliquid64/ciphersink-soe/blob/master/lib/viewControllers/selectOptionModal.js#L41