Commit 1ddeeb1
committed
Provide distinct event number for types defined by reference
Prior to this commit, message types defined by reference were exposed
to Rust as type aliases, such as `type KeyReleaseEvent =
KeyPressEvent;`. As a result, they shared a single implementation of
`BaseEvent`, erroneously sharing the same `BaseEvent::NUMBER`.
This commit updates the code generation to instead expose these types
as a wrapper struct, such as `struct KeyReleaseEvent(KeyPressEvent);`.
These wrapper structs expose the same methods, but have an independent
implementation of `BaseEvent`. This allows these events to be
constructed, such as for use in `SendEvent`.
Fixes #2141 parent eaddeda commit 1ddeeb1
2 files changed
+213
-128
lines changed
0 commit comments