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

SDL_TextEditingEvent.edit.start will go wrong #9761

Open
signin0 opened this issue May 11, 2024 · 0 comments
Open

SDL_TextEditingEvent.edit.start will go wrong #9761

signin0 opened this issue May 11, 2024 · 0 comments
Milestone

Comments

@signin0
Copy link

signin0 commented May 11, 2024

Keep pressing the left arrow and the error is 3

#include <SDL2/SDL.h>

int main(int argc, char *argv[]) {
    SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER);
    SDL_SetHint(SDL_HINT_IME_SHOW_UI, "1");
    SDL_CreateWindow("demo", 800, 80, 340, 740,SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE | SDL_RENDERER_PRESENTVSYNC);
    SDL_Event e;
    while (1) {
        if (SDL_PollEvent(&e)) {
            switch (e.type) {
                case SDL_QUIT:
                    return 0;
                case SDL_TEXTEDITING:
                    SDL_Log("%d|%d|%s\n", e.edit.start, e.edit.length, e.edit.text);
            }
        }
    }
}

image
It means a's|, but it's actually |a's

@signin0 signin0 changed the title SDL_TextEditingEvent.Edit.Start will go wrong SDL_TextEditingEvent.Edit.start will go wrong May 11, 2024
@signin0 signin0 changed the title SDL_TextEditingEvent.Edit.start will go wrong SDL_TextEditingEvent.edit.start will go wrong May 11, 2024
@slouken slouken added this to the 3.0 ABI milestone May 22, 2024
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

2 participants