Skip to content

Commit 1ddeeb1

Browse files
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 #214
1 parent eaddeda commit 1ddeeb1

File tree

2 files changed

+213
-128
lines changed

2 files changed

+213
-128
lines changed

0 commit comments

Comments
 (0)