[client] evdev: add new exclusive evdev while captured option

This commit is contained in:
Geoffrey McRae committed 2025-03-07 13:47:01 +11:00
1 parent 7c285a45fb
commit afbd844be8
6 files changed
+115 -14

No files matched your search

+17 -4
View File
@@ -18,13 +18,14 @@
* Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "app.h"
#include "app_internal.h"
#include "main.h"
#include "core.h"
#include "util.h"
#include "clipboard.h"
#include "render_queue.h"
#include "evdev.h"
#include "kb.h"
@@ -119,7 +120,7 @@ void app_handleFocusEvent(bool focused)
if (g_params.releaseKeysOnFocusLoss)
for (int key = 0; key < KEY_MAX; key++)
if (g_state.keyDown[key])
app_handleKeyRelease(key);
app_handleKeyReleaseInternal(key);
g_state.escapeActive = false;
@@ -311,7 +312,7 @@ void app_handleWheelMotion(double motion)
g_state.io->MouseWheel -= motion;
}
void app_handleKeyPress(int sc)
void app_handleKeyPressInternal(int sc)
{
if (!app_isOverlayMode() || !g_state.io->WantCaptureKeyboard)
{
@@ -375,7 +376,7 @@ void app_handleKeyPress(int sc)
}
}
void app_handleKeyRelease(int sc)
void app_handleKeyReleaseInternal(int sc)
{
if (g_state.escapeActive)
{
@@ -420,6 +421,18 @@ void app_handleKeyRelease(int sc)
}
}
void app_handleKeyPress(int sc)
{
if (!evdev_isExclusive())
app_handleKeyPressInternal(sc);
}
void app_handleKeyRelease(int sc)
{
if (!evdev_isExclusive())
app_handleKeyReleaseInternal(sc);
}
void app_handleKeyboardTyped(const char * typed)
{
ImGuiIO_AddInputCharactersUTF8(g_state.io, typed);