diff --git a/gale/Application.h b/gale/Application.h index 0581a74..7923901 100644 --- a/gale/Application.h +++ b/gale/Application.h @@ -194,6 +194,12 @@ namespace gale { * @param[in] _clipboardId Id of the clipboard. */ virtual void onClipboardEvent(enum gale::context::clipBoard::clipboardListe _clipboardId); + public: + /** + * @brief Call every time a draw is called (not entirely periodic, but faster at we can ... + * @param[in] _time Current time of the call; + */ + virtual void onPeriod(int64_t _time) {}; }; } diff --git a/gale/context/Context.cpp b/gale/context/Context.cpp index 505ba0a..c41ea8e 100644 --- a/gale/context/Context.cpp +++ b/gale/context/Context.cpp @@ -471,6 +471,7 @@ void gale::Context::OS_SetKeyboard(gale::key::Special& _special, } data->TypeMessage = eSystemMessage::msgKeyboardKey; data->stateIsDown = _isDown; + data->keyboardMove = gale::key::keyboard_char; data->keyboardChar = _myChar; data->keyboardSpecial = _special; data->repeateKey = _isARepeateKey; @@ -536,8 +537,6 @@ void gale::Context::clipBoardSet(enum gale::context::clipBoard::clipboardListe _ } bool gale::Context::OS_Draw(bool _displayEveryTime) { - // TODO : Remove this force at true ... - _displayEveryTime = true; int64_t currentTime = gale::getTime(); // this is to prevent the multiple display at the a high frequency ... #if (!defined(__TARGET_OS__Android) && !defined(__TARGET_OS__Windows)) @@ -558,9 +557,10 @@ bool gale::Context::OS_Draw(bool _displayEveryTime) { // set the curent interface : lockContext(); processEvents(); - // call all the widget that neded to do something periodicly - // TODO : m_objectManager.timeCall(currentTime); - // check if the user selected a windows + // call all the application for periodic request (the application manage multiple instance ... + if (m_application != nullptr) { + m_application->onPeriod(currentTime); + } if (m_application != nullptr) { // Redraw all needed elements m_application->onRegenerateDisplay(*this); diff --git a/gale/context/Context.h b/gale/context/Context.h index 104e2d6..807d5fb 100644 --- a/gale/context/Context.h +++ b/gale/context/Context.h @@ -111,9 +111,9 @@ namespace gale { * @brief The current context is set in background (framerate is slowing down (max fps)/5 # 4fps) */ virtual void OS_Background(); - + public: void requestUpdateSize(); - + protected: // return true if a flush is needed bool OS_Draw(bool _displayEveryTime); public: