Hello all, I'm trying to make a simple text box with SDL, I have loosely based it off of The Lazy Foo Tutorial on sting input, but this code doesn't seem to work...
if(event.type==SDL_MOUSEBUTTONDOWN){
if(isIn(event.button.x,event.button.y)){
hasFocus=true;
} else {
hasFocus=false;
}
}
if(event.type==SDL_KEYDOWN){
if(hasFocus){
if(event.key.keysym.sym!=SDLK_BACKSPACE){
str+=(char)(event.key.keysym.unicode);
} else {
if(str.length()!=0){
str.erase(str.length()-1);
}
}
}
}
From a debug the focusing works fine, as is the display, but for some reason the character is not getting appended. What can I do to fix this?