Skip to content
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

overlays/osk: respect ignore_device_events #14407

Merged
merged 2 commits into from Aug 4, 2023

Conversation

cipherxof
Copy link
Contributor

In Metal Gear Online there are certain situations where you should be unable to type or use the on screen keyboard, for example when you are stunned/asleep or when transitioning through a loading screen. This change more or less makes the OSK work as it should in MGO, however I'm not sure what real hardware expects or if this affects any of the other games that use native keyboard handling (there aren't many).

@Megamouse
Copy link
Contributor

I'll have to think about this properly.

@Megamouse
Copy link
Contributor

I think this is correct, but I don't remember why I opted for the current code after testing with some of your fellow players.
Knowing me there might be some edge case which I will probably never remember.

Just for future reference, this is how I believe the logic to be (during seperate windows).
Mask set to 0 means that the OSK has the input rights for all devices, a.k.a. "consumes" their input.
Mask set to "Pad" means that the OSK only has the input rights for the keyboard, meaning the game can consume the pad and mouse events.
Device lock means that the OSK does ignore all input (even though it technically consumes it).

So this leads us to the following table:

OSK Game Mask + Lock
No input All input OSK Closed
All input No input 0 + Unlocked
No input No input 0 + Locked
Only KB Only Pad+Mouse Pad + Unlocked
No input Only Pad+Mouse Pad + Locked

The 0 + Locked state is actually possible and basically means you can't do anything and have to hope the game closes the osk xD.

return;

if (!ignore_device_events && input_device.exchange(CELL_OSKDIALOG_INPUT_DEVICE_PAD) != CELL_OSKDIALOG_INPUT_DEVICE_PAD)
if (input_device.exchange(CELL_OSKDIALOG_INPUT_DEVICE_PAD) != CELL_OSKDIALOG_INPUT_DEVICE_PAD)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The check in 656 can now technically be removed.

return;

if (!ignore_device_events && input_device.exchange(CELL_OSKDIALOG_INPUT_DEVICE_KEYBOARD) != CELL_OSKDIALOG_INPUT_DEVICE_KEYBOARD)
if (input_device.exchange(CELL_OSKDIALOG_INPUT_DEVICE_KEYBOARD) != CELL_OSKDIALOG_INPUT_DEVICE_KEYBOARD)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The check in 912 can now technically be removed.

@Megamouse Megamouse merged commit 51a8d22 into RPCS3:master Aug 4, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants