Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/window_callbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ void WindowCallbacks::onMouseButton(double x, double y, int btn, MouseButtonActi
window.stopTextInput();
}
}
if(io.WantCaptureMouse) {
if(io.WantCaptureMouse && !window.getCursorDisabled()) {
return;
}
}
Expand All @@ -158,7 +158,7 @@ void WindowCallbacks::onMouseButton(double x, double y, int btn, MouseButtonActi
void WindowCallbacks::onMousePosition(double x, double y) {
if(hasInputMode(InputMode::Mouse)) {
#ifdef USE_IMGUI
if(ImGui::GetCurrentContext()) {
if(ImGui::GetCurrentContext() && !window.getCursorDisabled()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This now feels very inconsistent with the other mouse event handling

ImGuiIO& io = ImGui::GetIO();
io.AddMouseSourceEvent(ImGuiMouseSource_Mouse);
io.AddMousePosEvent(x, y);
Expand All @@ -184,7 +184,7 @@ void WindowCallbacks::onMouseRelativePosition(double x, double y) {
void WindowCallbacks::onMouseScroll(double x, double y, double dx, double dy) {
if(hasInputMode(InputMode::Mouse)) {
#ifdef USE_IMGUI
if(ImGui::GetCurrentContext()) {
if(ImGui::GetCurrentContext() && !window.getCursorDisabled()) {
ImGuiIO& io = ImGui::GetIO();
io.AddMouseSourceEvent(ImGuiMouseSource_Mouse);
io.AddMouseWheelEvent(dx, dy);
Expand Down Expand Up @@ -415,7 +415,7 @@ void WindowCallbacks::onKeyboard(KeyCode key, KeyAction action) {
window.stopTextInput();
}
}
if(io.WantCaptureKeyboard || io.WantTextInput) {
if((io.WantCaptureKeyboard || io.WantTextInput) && !window.getCursorDisabled()) {
return;
}
}
Expand Down Expand Up @@ -525,7 +525,7 @@ void WindowCallbacks::onKeyboard(KeyCode key, KeyAction action) {
}
void WindowCallbacks::onKeyboardText(std::string const& c) {
#ifdef USE_IMGUI
if(ImGui::GetCurrentContext()) {
if(ImGui::GetCurrentContext() && !window.getCursorDisabled()) {
ImGuiIO& io = ImGui::GetIO();
io.AddInputCharactersUTF8(c.data());
if(io.WantCaptureKeyboard) {
Expand Down
Loading