-
Notifications
You must be signed in to change notification settings - Fork 23
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
Implemented Screenshot and Home buttons custom events #89
base: wiliwili
Are you sure you want to change the base?
Conversation
It looks great! and I agree that it should be exclusive to Switch. However, I am not sure if I want to upgrade to C++20. Currently, wiliwili is compatible with some older platforms, such as macOS 10.11. Setting C++ to 20 may inadvertently introduce content that is not supported by these platforms in the future. Someone previously requested to detect headphone unplugging event, so that we can adjust the volume or pause video playback when the headphones are disconnected. This PR made me think that we might be able to write the relevant implementations together, but I'm not sure if libnx exposed such an event. By the way, according to the results of CI, it seems that this line raised an error in C++20, maybe you can delete the |
(cherry picked from commit 4cf9c53)
I think this PR should be in draft, I already see potential flaws of this solution, I.E. I also implemented Home button capturing, in current implementation they will conflict with each other, so probably they should produce Events and then app can decide what to do with them. For switch_video I already made a fix, I'll upload it tomorrow (it's 2:30 AM, I need to go to sleep) But I got your point about C++17, I'll try to exclude C++20 features from PR |
4229da7
to
8f03693
Compare
I've changed implementation a bit, now Screenshot and Home buttons have 3 modes:
I think this approach will be more flexible in terms of custom actions for this buttons. I also tried to find something related to headphones connection, but for now I'm out of luck, maybe it could have some weird name or notifies as part of anything else (if exposed at all) I could also expose Power button, but it's a bit too much I think :D |
(cherry picked from commit ab73b91)
8f03693
to
9eb77ac
Compare
Take a note that I added some c++20 specific code, so I've updated c++17 to 20 as well.
I didn't add any public access to replaceScreenshotWithGuideButton property, because I believe that this is highly Switch specific functionality, so to access it, you'l need to check platform first and call directly:
((SwitchInputManager*) brls::Application::getPlatform()->getInputManager())->setReplaceScreenshotWithGuideButton(...)
If you believe that this property could be useful for any other platform, I could move it to InputManager interface as well