diff --git a/client/include/app.h b/client/include/app.h index b849391b..72da3c66 100644 --- a/client/include/app.h +++ b/client/include/app.h @@ -43,6 +43,7 @@ bool app_inputEnabled(void); bool app_isCaptureMode(void); bool app_isCaptureOnlyMode(void); bool app_isFormatValid(void); +bool app_isOverlayMode(void); void app_updateCursorPos(double x, double y); void app_updateWindowPos(int x, int y); void app_handleResizeEvent(int w, int h, double scale, const struct Border border); @@ -59,6 +60,8 @@ void app_handleButtonRelease(int button); void app_handleWheelMotion(double motion); void app_handleKeyPress(int scancode); void app_handleKeyRelease(int scancode); +void app_handleKeyboardTyped(const char * typed); +void app_handleKeyboardModifiers(bool ctrl, bool shift, bool alt, bool super); void app_handleEnterEvent(bool entered); void app_handleFocusEvent(bool focused); void app_handleCloseEvent(void); diff --git a/client/src/app.c b/client/src/app.c index 6054e835..c73d5628 100644 --- a/client/src/app.c +++ b/client/src/app.c @@ -63,6 +63,11 @@ bool app_isFormatValid(void) return g_state.formatValid; } +bool app_isOverlayMode(void) +{ + return g_state.overlayInput; +} + void app_updateCursorPos(double x, double y) { g_cursor.pos.x = x; @@ -394,6 +399,19 @@ void app_handleKeyRelease(int sc) } } +void app_handleKeyboardTyped(const char * typed) +{ + ImGuiIO_AddInputCharactersUTF8(g_state.io, typed); +} + +void app_handleKeyboardModifiers(bool ctrl, bool shift, bool alt, bool super) +{ + g_state.io->KeyCtrl = ctrl; + g_state.io->KeyShift = shift; + g_state.io->KeyAlt = alt; + g_state.io->KeySuper = super; +} + void app_handleMouseRelative(double normx, double normy, double rawx, double rawy) {