mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-12-23 22:13:40 +00:00
[client] move imgui input state reset to it's own core function
This commit is contained in:
parent
a11a20411b
commit
f49948506b
@ -77,15 +77,9 @@ void app_handleFocusEvent(bool focused)
|
|||||||
{
|
{
|
||||||
g_state.focused = focused;
|
g_state.focused = focused;
|
||||||
|
|
||||||
|
// release any imgui buttons/keys if we lost focus
|
||||||
if (!focused && g_state.overlayInput)
|
if (!focused && g_state.overlayInput)
|
||||||
{
|
core_resetOverlayInputState();
|
||||||
// release any imgui buttons/keys if we lost focus
|
|
||||||
g_state.io->MouseDown[ImGuiMouseButton_Left ] = false;
|
|
||||||
g_state.io->MouseDown[ImGuiMouseButton_Right ] = false;
|
|
||||||
g_state.io->MouseDown[ImGuiMouseButton_Middle] = false;
|
|
||||||
for(int key = 0; key < sizeof(g_state.io->KeysDown) / sizeof(bool); key++)
|
|
||||||
g_state.io->KeysDown[key] = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!core_inputEnabled())
|
if (!core_inputEnabled())
|
||||||
{
|
{
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
#include "common/time.h"
|
#include "common/time.h"
|
||||||
#include "common/debug.h"
|
#include "common/debug.h"
|
||||||
|
#include "common/array.h"
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
@ -522,3 +523,12 @@ void core_handleMouseNormal(double ex, double ey)
|
|||||||
if (!spice_mouse_motion(x, y))
|
if (!spice_mouse_motion(x, y))
|
||||||
DEBUG_ERROR("failed to send mouse motion message");
|
DEBUG_ERROR("failed to send mouse motion message");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void core_resetOverlayInputState(void)
|
||||||
|
{
|
||||||
|
g_state.io->MouseDown[ImGuiMouseButton_Left ] = false;
|
||||||
|
g_state.io->MouseDown[ImGuiMouseButton_Right ] = false;
|
||||||
|
g_state.io->MouseDown[ImGuiMouseButton_Middle] = false;
|
||||||
|
for(int key = 0; key < ARRAY_LENGTH(g_state.io->KeysDown); key++)
|
||||||
|
g_state.io->KeysDown[key] = false;
|
||||||
|
}
|
||||||
|
@ -36,5 +36,6 @@ void core_stopFrameThread(void);
|
|||||||
void core_handleGuestMouseUpdate(void);
|
void core_handleGuestMouseUpdate(void);
|
||||||
void core_handleMouseGrabbed(double ex, double ey);
|
void core_handleMouseGrabbed(double ex, double ey);
|
||||||
void core_handleMouseNormal(double ex, double ey);
|
void core_handleMouseNormal(double ex, double ey);
|
||||||
|
void core_resetOverlayInputState(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user