Problem
synthesizeKeyEvent returns a plain object asserted as OpenTUI's KeyEvent.
The synthetic object contains the chord fields used by current matching, but omits required event fields such as eventType and source. Its preventDefault and stopPropagation methods also do not update the state exposed by real KeyEvent getters.
The current round-trip test only verifies chord matching. Synthetic events are also passed to command matchers and programmatically invoked handlers, which may legitimately inspect the rest of the KeyEvent contract.
Proposed direction
Construct the exported OpenTUI KeyEvent class with a complete parsed-key payload instead of asserting a partial object.
Use explicit synthetic defaults such as eventType: "press" and source: "raw" unless a more appropriate source is available.
Acceptance criteria
synthesizeKeyEvent returns a real KeyEvent instance without a double assertion.
- Existing chord matching behavior remains unchanged.
eventType and source are populated.
preventDefault and stopPropagation update the corresponding observable state.
- Extend tests beyond chord round-tripping to cover the complete synthetic event behavior.
Problem
synthesizeKeyEventreturns a plain object asserted as OpenTUI'sKeyEvent.The synthetic object contains the chord fields used by current matching, but omits required event fields such as
eventTypeandsource. ItspreventDefaultandstopPropagationmethods also do not update the state exposed by realKeyEventgetters.The current round-trip test only verifies chord matching. Synthetic events are also passed to command matchers and programmatically invoked handlers, which may legitimately inspect the rest of the
KeyEventcontract.Proposed direction
Construct the exported OpenTUI
KeyEventclass with a complete parsed-key payload instead of asserting a partial object.Use explicit synthetic defaults such as
eventType: "press"andsource: "raw"unless a more appropriate source is available.Acceptance criteria
synthesizeKeyEventreturns a realKeyEventinstance without a double assertion.eventTypeandsourceare populated.preventDefaultandstopPropagationupdate the corresponding observable state.