Skip to content

withKeys: no surface area on Lynx — document as no-op and close #170

@KealanAU

Description

@KealanAU

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions