Skip to content

Commit 3820c5b

Browse files
yurugerikmd
andcommitted
fix(partition-view): Use Ctrl-click or ⌘-click (instead of middle-click)
This new key-binding is macOS-compliant (tested with both Firefox and Safari). Co-Authored-By: Yann Regis-Gianas <[email protected]> Co-Authored-By: Érik Martin-Dorel <[email protected]>
1 parent c6300b0 commit 3820c5b

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

docs/howto-classify-students-answers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Follow these steps:
2121

2222
1. Go to the teaching tab in the LearnOCaml Web UI (needs a teacher token).
2323

24-
2. Middle-click on the exercise `x` in the list of exercises.
24+
2. Hold Ctrl (on macOS: Hold ⌘) and left click on the exercise `x` in the list of exercises.
2525

2626
3. Enter `foo` in the dialog box.
2727

src/app/learnocaml_teacher_tab.ml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,13 @@ let rec teacher_tab token _select _params () =
236236
H.a_ondblclick (fun _ -> open_exercise_ ());
237237
H.a_onmouseup (fun ev ->
238238
Js.Optdef.case ev##.which (fun () -> true) @@ fun btn ->
239-
if btn = Dom_html.Middle_button then open_partition_ () else true);
239+
if (Js.to_bool ev##.ctrlKey ||
240+
Js.to_bool ev##.metaKey (* ⌘ on macOS *))
241+
&& btn = Dom_html.Left_button
242+
then
243+
open_partition_ ()
244+
else
245+
true);
240246
] [
241247
auto_checkbox_td ();
242248
H.td ~a:[indent_style group_level]

0 commit comments

Comments
 (0)