Investigation
Before implementing withKeys, I investigated whether Lynx exposes event.key on any platform.
Web preview — keydown fires but key is stripped
The web preview does fire keydown events, but the Worker boundary crossing (createCrossThreadEvent) strips all keyboard-specific fields. The payload received in the BG thread:
{"type":"keydown","timestamp":5272.4,"target":{"uniqueId":18},"currentTarget":{"uniqueId":18},"detail":0,"params":{}}
No key, no code, no keyCode. params is empty.
Native — hardware keyboard Enter never reaches JS as keydown
Tested via simulator with a physical Mac keyboard (BKSHIDKeyboardDevice, layout "Australian"). The iOS UIEvent type 4 (keyboard) was received and recognised, but Lynx's C++ core intercepted it before JS:
Keyboard receives keyEvent type: 4; subtype: 0
Keyboard adds a string
[touch_event_handler.cc(367)] SendCustomEvent event name:confirm tag:29
touch_event_handler.cc converts Enter directly to confirm. No keydown is ever emitted to the JS layer — regardless of whether the keyboard is virtual or physical.
Conclusion
withKeys has no surface area on any Lynx target:
| Platform |
keydown fires? |
event.key available? |
| Lynx web preview |
Yes |
No — stripped at Worker boundary |
| Lynx native (virtual keyboard) |
No |
N/A |
| Lynx native (hardware keyboard) |
No — converted to confirm by touch_event_handler.cc |
N/A |
The existing stub (return fn) is the correct runtime behaviour. The only gap is documentation.
Proposal
PR: #(171)
Investigation
Before implementing
withKeys, I investigated whether Lynx exposesevent.keyon any platform.Web preview —
keydownfires butkeyis strippedThe web preview does fire
keydownevents, but the Worker boundary crossing (createCrossThreadEvent) strips all keyboard-specific fields. The payload received in the BG thread:{"type":"keydown","timestamp":5272.4,"target":{"uniqueId":18},"currentTarget":{"uniqueId":18},"detail":0,"params":{}}No
key, nocode, nokeyCode.paramsis empty.Native — hardware keyboard Enter never reaches JS as
keydownTested via simulator with a physical Mac keyboard (
BKSHIDKeyboardDevice, layout "Australian"). The iOS UIEvent type 4 (keyboard) was received and recognised, but Lynx's C++ core intercepted it before JS:touch_event_handler.ccconverts Enter directly toconfirm. Nokeydownis ever emitted to the JS layer — regardless of whether the keyboard is virtual or physical.Conclusion
withKeyshas no surface area on any Lynx target:keydownfires?event.keyavailable?confirmbytouch_event_handler.ccThe existing stub (
return fn) is the correct runtime behaviour. The only gap is documentation.Proposal
withKeysexplaining why it's a no-op (same pattern as.preventfrom Feature(event-modifiers): add event modifier (self, once, prevent, stop) #155)PR: #(171)