SDL_TEXTINPUT happens too often |
TheSHEEEP
|
Besides, even if there is no way to prevent this, I am curious about the reason behind this behavior.
Also, I am using SDL2 with MinGW on Windows. I did not test yet if the same thing happens on linux. |
|||||||||||
|
SDL_TEXTINPUT happens too often |
Rainer Deyke
Guest
|
On 31.03.2015 11:11, TheSHEEEP wrote:
It works for me, so my guess would be that the bug is on your side. Can you post a minimal example program that demonstrates the problem? -- Rainer Deyke _______________________________________________ SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||||
|
SDL_TEXTINPUT happens too often |
Bob Rubbens
Guest
|
A minimal example would be great. Are you maybe mixing up SDL_TEXTINPUT and SDL_TEXTEDITING events? Did you use SDL_StartTextInput() properly?
On 31 March 2015 at 15:08, Rainer Deyke wrote:
|
|||||||||||||||
|
SDL_TEXTINPUT happens too often |
Daniel Gibson
Guest
|
On 03/31/2015 11:11 AM, TheSHEEEP wrote:
If you're holding the button down for too long key repeat will kick in (I /think/ the delay is controlled by your OS). You might also want to tell us what exact version of SDL2 you're using and which OS. Cheers, Daniel _______________________________________________ SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||||
|
TheSHEEEP
|
The button is definitely not held down too long, and the repeated input when you do hold down a key for longer also works well.
The OS is Windows 8.1, and the SDL2 version is 2.0.1.
Define properly. I do call it when the application starts. I am aware that I could do this far more fine grained, but that is a lower priority task. About the other event: I do not handle SDL_TEXTEDITING at all, as the GUI library I use handles that well on its own when injecting key down/up events. A minimal example I cannot give you as the application is too complex. The SDL input loop is this, however:
I stripped away our own code, but we do nothing with the events except reading them. |
|||||||||||||||
|
SDL_TEXTINPUT happens too often |
Bob Rubbens
Guest
|
That's what I mean by properly. Your minimal example looks fine, except for the superfluous SDL_PumpEvents() (SDL_PollEvent should call it internally iirc) and the fact that it's maybe too minimal. Can you provide a minimal compileable example that replicates the bug? (So we can actually do g++ bug.cpp -lSDL2 or something similar and see for ourselves if it's indeed an SDL2 bug?) The minimal example in question doesn't need any of the code from your program, just make sure it contains the odd behaviour you describe.
Also, you say your GUI library "injects" keyup/keydown events? I'm probably misinterpreting it but it sounds suspicious. Maybe your gui library has functions for getting keyboard input so you don't have to pay attention to SDL_TEXTINPUT event? If there are, try those and see if your problem persists. Lastly, is there a reason not to use SDL 2.0.3? Just my 2 cents, sorry if I'm being too nosy :p On 31 March 2015 at 15:59, TheSHEEEP wrote:
|
|||||||||||||
|
Re: SDL_TEXTINPUT happens too often |
TheSHEEEP
|
No, I do inject key up/down events into the GUI library (CEGUI) For example, if there is a text field containing "aaabbb" and I inject a backspace down, it becomes "aaabb" on its own. I do not need to manually change any text (which I guess the TEXTEDIT event is for).
No real reason other than us having no problems with the version we are currently using. If we wanted to keep up with all recent releases of all libs we are using we would never get any actual work done I have the workaround implemented already (checking for duplicate events during an input loop), it is no big deal. In light of that, finding out exactly what is going wrong is just too much effort atm, so sorry I can't give you a compilable example right now. |
|||||||||||||||
|
SDL_TEXTINPUT happens too often |
Daniel Gibson
Guest
|
On 03/31/2015 04:42 PM, TheSHEEEP wrote:
You do, otherwise you wouldn't be writing here
Sure that this won't fuck up if users actually want to keypresses? Do you maybe insert chars for keydown events as well (you shouldn't.)? BTW, as you're using CEGUI you have to translate SDL2 scancodes to directinput/cegui scancodes. This may help: https://github.com/DanielGibson/DOOM-3-BFG/blob/e37671d6ac408dc1029c50ddaa26e60e56759c7a/neo/sys/sdl/sdl2_scancode_mappings.h
Can you try to reproduce the problem with this minimal example, which will print out textinput events (into sdl2_test_out.txt on Windows): http://p.carnivore.it/5uDkS9 That should help you to check if the bug really is in SDL or in your code. Cheers, Daniel _______________________________________________ SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||||||||
|
SDL_TEXTINPUT happens too often |
Jonny D
|
SDL 2.0.3 is a bug fix release. So if you are experiencing a bug with the version you have, then you should try the latest release to make sure that it isn't something that was fixed years ago.
Jonny D On Tue, Mar 31, 2015 at 10:42 AM, TheSHEEEP wrote:
|
|||||||||||||
|