RE-UE4SS
RE-UE4SS copied to clipboard
Port/inputsource: Refactor Abstracted Input Handler
Description
The original Input Handler only accepted input from Win32. In the refactoring we have defined the input source as Input Source, which allows different input sources to be defined for different scenarios. QueueInputSource allows messages from other threads to generate keyboard input and be dispatched and responded to by the process_event
thread via the SPSC queue.
Almost all of the definitions remain unchanged, with the only exception that get_events()
has been replaced by get_events_safe()
, which allows the use of mutex protection when accessing m_key_set
.
ModifierKeys are re-implemented using bitwise operations on uint32_t
, which simplifies storing and comparing modifier keys.
This PR depends on the string change so you can see those commits...
Type of change
Please delete options that are not relevant.
- [x] Breaking change (fix or feature that would cause existing functionality to not work as expected)
How Has This Been Tested?
Compiled and tested on Palworld, may need extra tests to ensure keys are responsed correctly as I only tested basic ones.
Checklist
Please delete options that are not relevant. Update the list as the PR progresses.
- [x] I have commented my code, particularly in hard-to-understand areas.
- [ ] I have made corresponding changes to the documentation.
- [ ] I have added the necessary description of this PR to the changelog, and I have followed the same format as other entries.
- [ ] Any dependent changes have been merged and published in downstream modules.
Screenshots (if appropriate)
Additional context
Add any other context about the pull request here.