ppy / osu

rhythm is just a *click* away!
https://osu.ppy.sh
MIT License
15.04k stars 2.22k forks source link

Can't type in textfields when running from iOS simulator #27984

Open smallketchup82 opened 4 months ago

smallketchup82 commented 4 months ago

Type

Game behaviour

Bug description

When running osu! in an iOS simulator, you can't type into textfields. Keybinds like ppp still work, so input is being detected. Typing on other apps like safari works, so it doesn't seem to be an issue with how my xcode/keyboard is set up.

Simulator specs:

My Macbook's specs:

image

Running osu! master on commit a35bf77

Screenshots or videos

No response

Version

a35bf77

Logs

Since this is an iOS simulator, I can't get the logs folder. I've included the debug logs from the console output logs.txt

Susko3 commented 4 months ago

Relevant bit from the logs (not sure what it means):

2024-04-24 10:40:21.292299-0400 osu.iOS[54572:4257604] [HardwareKeyboard] -[UIApplication getKeyboardDevicePropertiesForSenderID:shouldUpdate:usingSyntheticEvent:], failed to fetch device property for senderID (778835616971358209) use primary keyboard info instead.
2024-04-24 10:40:21.305208-0400 osu.iOS[54572:4257604] [HardwareKeyboard] -[UIApplication getKeyboardDevicePropertiesForSenderID:shouldUpdate:usingSyntheticEvent:], failed to fetch device property for senderID (778835616971358209) use primary keyboard info instead.

Could you enable SDL3 event logging and then post the output. Just add the following line to the main program:

SDL3.SDL_SetHint(SDL3.SDL_HINT_EVENT_LOGGING, "1"u8);
smallketchup82 commented 4 months ago

@Susko3 Doesn't seem like I can do that. 1>Application.cs(12,13): Error CS0103 : The name 'SDL3' does not exist in the current context. There's no option to reference it from somewhere else either..?

I can do the same thing but change it to SDL2.SDL.SDL_SetHint(SDL2.SDL.SDL_HINT_EVENT_LOGGING, "1");, but when trying to run with that, I get System.DllNotFoundException: SDL2

Susko3 commented 4 months ago

You shouldn't have access to SDL2 on the latest master, the SDL3 update has already been merged. Please delete bin and obj folders (they should be in osu.iOS/) and then clean and rebuild your solution and project. Also ensure you're on the latest master commit.

smallketchup82 commented 4 months ago

Right, I was accidentally on a different branch when I tested it earlier today. Going back to the commit listed in the original comment, I still get a System.DllNotFoundException: SDL3 when I put SDL3.SDL_SetHint(SDL3.SDL_HINT_EVENT_LOGGING, "1"u8); in Application.cs. Probably an issue with the entrypoint.

smoogipoo commented 4 months ago

You should put that hint in SDL3Window. Check the existing code there for where you might put it.

Susko3 commented 4 months ago

Just put it anywhere in the game, like the constructor of OsuGame, if you don't have a local checkout of framework (required for SDL3Window change).

smallketchup82 commented 4 months ago

~~Got it, I put it in the load() function of OsuGame. Here are the logs: log2.txt~~

smallketchup82 commented 4 months ago

Hold on, I forgot to enable hardware keyboard. Disregard the above logs log3.txt

I started the game, opened the sign in menu, and tried pressing random keys into the username field.

Susko3 commented 4 months ago

I presume you're typing with your mac keyboard. What if you instead try to type with the on-screen keyboard in iOS (if that option is available)?

I've created an upstream issue: https://github.com/libsdl-org/SDL/issues/9624. Feel free to subscribe to it.

smallketchup82 commented 4 months ago

If I disable hardware keyboard (so that it cannot recognize my macbook keyboard), the software keyboard doesn't show, neither automatically nor manually (via the toggle software keyboard button).

The on screen keyboard also does not show if my hardware keyboard is turned on, nether automatically nor manually.