diff --git a/virtual_keyboard.cpp b/virtual_keyboard.cpp index ae3ecc5..4412992 100644 --- a/virtual_keyboard.cpp +++ b/virtual_keyboard.cpp @@ -88,8 +88,6 @@ VirtualKeyboard::VirtualKeyboard(Font *font) : GuiView() void VirtualKeyboard::draw(SDL_Surface *where, int x_base, int y_base, int w, int h) { - int screen_w = where->w; - int screen_h = where->h; int key_w = w / KEY_COLS; int key_h = h / KEY_ROWS; SDL_Rect bg_rect = {x_base, y_base, @@ -359,6 +357,13 @@ void VirtualKeyboard::flushKeyListeners() memset(this->stringListeners, 0, sizeof(this->stringListeners)); } +void VirtualKeyboard::deactivate() +{ + this->is_active = false; + this->flushKeyListeners(); + Gui::gui->popView(); +} + void VirtualKeyboard::draw(SDL_Surface *where) { this->draw(where, 20, 240, 600, 240); diff --git a/virtual_keyboard.hh b/virtual_keyboard.hh index f312b77..ac45595 100644 --- a/virtual_keyboard.hh +++ b/virtual_keyboard.hh @@ -56,11 +56,7 @@ public: this->font = font; } - void deactivate() - { - this->is_active = false; - this->flushKeyListeners(); - } + void deactivate(); bool isActive() {