Hi guys, I’ve got a bit of a weird one I’m trying to wrap my head around. When using SDL_StartTextInput(), followed by a normal event loop, something a bit like this;
while (!done) {
SDL_Event event;
if (SDL_PollEvent(&event)) {
switch (event.type) {
case SDL_TEXTINPUT:
// handle the text input event here
// blah blah rest of code complete the loops etc
I am getting seg faults when “Shift-3” is pressed (which on my UK keyboard corresponds to £). Everything else works fine, and I can string input all the rest of the symbols (!, ", %, etc…), capital letters (A, B, C) etc. But for some reason with SDL_StartTextInput() turned on polling a Shift-3 event causes immediate seg fault and crash, even if I comment out all of the handling code below PollEvent()
If I turn off SDL_StartTextInput() and handle keys in the usual way (SDL_KEYDOWN, using keysym and mod etc) then I don’t have a problem - but for convenience I’d like to use the textinput feature of SDL2.
I’m guessing this is some weird localization option, and if my keyboard was US keyboard it wouldn’t fault? Any work around for this? I’m running linux btw.
I did try googling this fault before posting, couldn’t find anything. I’m guessing its a bug with the SDL version I’m using…
Appreciate any help on this one guys, I’m making huge progress with a major project and but need to get input events nicely resolved!