Implement backspace support

This commit is contained in:
simon.kagstrom 2010-01-30 15:52:35 +00:00
parent b7064f58f0
commit 187eb13245

View File

@ -335,7 +335,7 @@ void VirtualKeyboard::runLogic()
if (this->buf_head > 1) if (this->buf_head > 1)
{ {
this->buf[this->buf_head - 1] = INVALID_VIRTKEY; this->buf[this->buf_head - 1] = INVALID_VIRTKEY;
this->buf_head -= 2; this->buf_head--;
} }
} }
else else
@ -430,6 +430,10 @@ void VirtualKeyboard::pushEvent(SDL_Event *ev)
case SDLK_RSHIFT: case SDLK_RSHIFT:
case SDLK_LSHIFT: case SDLK_LSHIFT:
this->shift_on = !this->default_shifted; break; this->shift_on = !this->default_shifted; break;
case SDLK_BACKSPACE:
if (this->buf_head > 0)
this->buf_head--;
break;
case SDLK_UP: case SDLK_UP:
case SDLK_DOWN: case SDLK_DOWN:
case SDLK_LEFT: case SDLK_LEFT: