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

using on-screen keyboard on iOS crashes in event poll #11708

Closed
ronaaron opened this issue Dec 24, 2024 · 10 comments
Closed

using on-screen keyboard on iOS crashes in event poll #11708

ronaaron opened this issue Dec 24, 2024 · 10 comments

Comments

@ronaaron
Copy link

I've almost got my app running on iOS now, but there's one problem.

In text entry fields, I call SDL_StartTextInput() and the on-screen keyboard pops up as expected. But when I press any 'key', the app crashes.

According to XCode this is happening in SDL_PollEvent() (I changed to using SDL_WaitEventTimeout() with the same result).

Thread 1: EXC_BAD_ACCESS (code=1, address=0x10)
A bad access to memory terminated the process.

TBF, I'm compiling SDL2 manually, but I use the configure script except I also add the UIKIT defines so it'll work on iOS. Anyway, I'm unsure how to proceed...

@slouken
Copy link
Collaborator

slouken commented Dec 24, 2024

We'll need a call stack to see what's going on here.

@ronaaron
Copy link
Author

image

@ronaaron
Copy link
Author

image

@ronaaron
Copy link
Author

Somewhere it looks like the 'committedText' gets messed up. I don't see where, though.

@slouken
Copy link
Collaborator

slouken commented Dec 26, 2024

Can you try the latest SDL3 code? We just made a change to reset the committed text when text input is stopped.

@ronaaron
Copy link
Author

I can't really drop-in SDL3 right now, but I'll take a look at the diff from 2.30.8 and see if the fix fixes it for me.

@ronaaron
Copy link
Author

The changes from 2.30.8 to most recent trunk in uikitcontroller for committedText don't make any difference I can see. I copied the few changes over, no difference.

@slouken
Copy link
Collaborator

slouken commented Dec 26, 2024

Okay, can you reproduce this with any of the SDL test programs? checkkeys is a good one to try out.

@slime73
Copy link
Contributor

slime73 commented Dec 26, 2024

I'm compiling SDL2 manually, but I use the configure script except I also add the UIKIT defines so it'll work on iOS.

Are you still able to reproduce it if you use the xcodebuild command-line tool with the xcode project (or build via Xcode's UI) instead of manually adding iOS support to the other build system?

@ronaaron
Copy link
Author

Well hell. When I use XCode to build it, the library works. So I guess this should be closed...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants