Skip to content
This repository has been archived by the owner on Feb 6, 2025. It is now read-only.

Commit

Permalink
glfw: set raw_mouse_motion to true if cursor is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
xdBronch authored and Stephen Gutekanst committed Jun 3, 2023
1 parent 100617d commit 8e091ce
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Window.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1531,7 +1531,12 @@ pub const InputModeCursor = enum(c_int) {

/// Sets the input mode of the cursor, whether it should behave normally, be hidden, or grabbed.
pub inline fn setInputModeCursor(self: Window, value: InputModeCursor) void {
return self.setInputMode(InputMode.cursor, value);
if (value == .disabled) {
self.setInputMode(.cursor, value);
return self.setInputMode(.raw_mouse_motion, true);
}
self.setInputMode(.cursor, value);
return self.setInputMode(.raw_mouse_motion, false);
}

/// Gets the current input mode of the cursor.
Expand Down

0 comments on commit 8e091ce

Please sign in to comment.