-
Notifications
You must be signed in to change notification settings - Fork 337
Add UE method for handling key binds #785
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Benefits of this are: 1. Cross-platform keybinds with no effort, and very low maintenance burden. 2. We can cull the entire "Input" dependency.
This is because I don't think we should entirely remove the old system yet. The new system needs to be battle tested, and the old one should only be removed after we can guarantee that the new one always works. As of this commit, we are defaulting to the old one, but this can change.
This is temporary, just to test that it works, and it does work. Eventually this will still go through 'register_keydown_event', which will simply forward to the UE system if the UE system has been selected in the ini.
|
Note that this currently uses |
|
I wanted to focus specifically on our own key binds, and Lua support will come automatically with the regular functions.
Do you have any alternatives to the PlayerController functions ?
The goal is to make it work on servers, and I even have a comment in the code about this, but it may take some time. To be clear: Making this new system the default is completely unacceptable without support for servers. |
|
Yeah, we literally have a section in the ini for experimental features.. which the function caller should probably be moved out of and the GUI rendering thread moved into tbh. |
I'm giving general feedback based on my experience, which is in scope of the RP, because in my opinion the PR changes are useless, if you can't rely on these functions at all time. They are not suited to be used as global hotkeys.
Since I didn't want to deal with unreflected functions and properties, I didn't find any. |
|
Eventually I would like to directly read UE's array of inputs from the frame |
Description
Note: This is a very early draft! It will change a lot, and might not be merged in the end, we'll see how it goes.
This PR adds UEs own input handling as a method we can use for our own key binds.
The system uses two reflected functions:
APlayerController::IsInputKeyDownandAPlayerController::WasInputKeyJustPressed.The reasons why it doesn't replace our own system entirely: I don't know if every game has the necessary functions.
If the new system is battle tested and works in all games, we can drop our own system.
Otherwise, we'll need to keep our own system still as a fallback.
Reasons for replacing our current system:
Inputdependency, which is an old homegrown solution that I wouldn't recommend to anyone.Initial goals:
register_keydown_eventfunctions, and there may need to be some small wrappers in theInputnamespace.Performance impact has not been tested.
Type of change
Checklist