summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorMitya Selivanov <automainint@guattari.tech>2023-10-01 22:33:47 +0200
committerMitya Selivanov <automainint@guattari.tech>2023-10-01 22:33:47 +0200
commit626a55cee50cfe3f883c83b4031b2d749806c32b (patch)
tree2889f50ac38138e5a26ac6da34353eca1497ec0e /source
parentca4f9de8435aebd2d863a03c27b6aac63cdf8abf (diff)
downloadsaw-626a55cee50cfe3f883c83b4031b2d749806c32b.zip
Web: Don't lock mouse
Diffstat (limited to 'source')
-rw-r--r--source/saw/main.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/saw/main.c b/source/saw/main.c
index a2ccbb5..e100e61 100644
--- a/source/saw/main.c
+++ b/source/saw/main.c
@@ -768,7 +768,10 @@ static void saw_ui_track(saw_track_t *track, i64 x0, i64 y0,
if (!saw_lbutton_down && track->value_input != TRACK_INPUT_NONE) {
track->value_input = TRACK_INPUT_NONE;
track->value_buffer = 0;
+
+#ifndef __EMSCRIPTEN__
sapp_lock_mouse(0);
+#endif
}
for (i32 input_index = TRACK_INPUT_INSTRUMENT;
@@ -793,7 +796,11 @@ static void saw_ui_track(saw_track_t *track, i64 x0, i64 y0,
if (saw_lbutton_click &&
track->value_input == TRACK_INPUT_NONE) {
+
+#ifndef __EMSCRIPTEN__
sapp_lock_mouse(1);
+#endif
+
track->value_input = input_index;
switch (input_index) {