Skip to content

handlevents in sdlayer2.c doesn't receive characters through SDL_TEXTINPUT when using sdl2-compat #28

@randomusername-a

Description

@randomusername-a

The SDL2 documentation says that to start accepting SDL_TEXTINPUT events you have to call SDL_StartTextInput, and adds that SDL_StartTextInput gets called automatically at video subsystem initialization on desktop platforms. The SDL3 version of the documentation only says "Text input events are not received by default," and looks like sdl2-compat doesn't change this behavior. This makes consumers of 'bgetchar' (eg. the 'build' program on jfduke3d) receive no characters because they only exist as keypresses ('bgetkey'). The SDL2 documentation also says that, on some platforms, SDL_StartTextInput shows the screen keyboard or activates IME, so maybe just forcefully always calling SDL_StartTextInput isn't the best solution, specially because some users of 'bgetchar' (eg. again, the 'build' program) just want to get single keypresses as characters instead of implementing actual text input.

Sources:
https://wiki.libsdl.org/SDL2/SDL_StartTextInput
https://wiki.libsdl.org/SDL3/SDL_StartTextInput

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions