- case SDL_TEXTEDITING:
- /* FIXME - We should handle this for complete input method support */
- break;
- case SDL_TEXTINPUT:
- str.insert(*charselected, evenement.text.text);
- (*charselected) += strlen(evenement.text.text);
- break;
- case SDL_KEYDOWN:
- if (evenement.key.keysym.sym == SDLK_ESCAPE) {
- str.clear();
- *charselected = 0;
- waiting = false;
- } else if (evenement.key.keysym.sym == SDLK_BACKSPACE) {
- if ((*charselected) > 0) {
- (*charselected)--;
- str.erase(*charselected, 1);
- }
- } else if (evenement.key.keysym.sym == SDLK_DELETE) {
- if ((*charselected) < str.size()) {
- str.erase(*charselected, 1);
+ case SDL_TEXTEDITING:
+ /* FIXME - We should handle this for complete input method support */
+ break;
+ case SDL_TEXTINPUT:
+ str.insert(*charselected, evenement.text.text);
+ (*charselected) += strlen(evenement.text.text);
+ break;
+ case SDL_KEYDOWN:
+ if (evenement.key.keysym.sym == SDLK_ESCAPE) {
+ str.clear();
+ *charselected = 0;
+ waiting = false;
+ } else if (evenement.key.keysym.sym == SDLK_BACKSPACE) {
+ if ((*charselected) > 0) {
+ (*charselected)--;
+ str.erase(*charselected, 1);
+ }
+ } else if (evenement.key.keysym.sym == SDLK_DELETE) {
+ if ((*charselected) < str.size()) {
+ str.erase(*charselected, 1);
+ }
+ } else if (evenement.key.keysym.sym == SDLK_HOME) {
+ (*charselected) = 0;
+ } else if (evenement.key.keysym.sym == SDLK_END) {
+ (*charselected) = str.size();
+ } else if (evenement.key.keysym.sym == SDLK_LEFT) {
+ if ((*charselected) != 0) {
+ (*charselected)--;
+ }
+ } else if (evenement.key.keysym.sym == SDLK_RIGHT) {
+ if ((*charselected) < str.size()) {
+ (*charselected)++;
+ }
+ } else if (evenement.key.keysym.sym == SDLK_RETURN) {
+ waiting = false;