diff --git a/README.md b/README.md index d243b49..d916611 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,8 @@ There is a fire-and-forget `make` wrapper around the build script. PortMIDI is an optional dependency. It can be enabled by adding the option `--portmidi` when running the `tool` build script. +You can also disable the mouse by adding the `--nomouse` option, useful to avoid accidental touchpad clicks. + ### Make ```sh diff --git a/tool b/tool index f34df70..9d70071 100755 --- a/tool +++ b/tool @@ -30,6 +30,8 @@ Optional Features: --portmidi Enable hardware MIDI output support with PortMIDI. Default: not enabled Note: PortMIDI has memory leaks and bugs. + --nomouse Disables mouse clicks. + Default: not enabled (mouse enabled). EOF } @@ -50,6 +52,7 @@ stats_enabled=0 pie_enabled=0 static_enabled=0 portmidi_enabled=0 +mouse_disabled=0 while getopts c:dhsv-: opt_val; do case "$opt_val" in @@ -59,6 +62,7 @@ while getopts c:dhsv-: opt_val; do static) static_enabled=1;; pie) pie_enabled=1;; portmidi) portmidi_enabled=1;; + nomouse) mouse_disabled=1;; *) echo "Unknown long option --$OPTARG" >&2 print_usage >&2 @@ -337,6 +341,9 @@ build_target() { echo -e "Warning: The PortMIDI library contains bugs.\\nIt may trigger address sanitizer in debug builds.\\nThese are not bugs in orca." >&2 fi fi + if [[ $mouse_disabled = 1 ]]; then + add cc_flags -DFEAT_NOMOUSE + fi ;; esac try_make_dir "$build_dir" diff --git a/tui_main.c b/tui_main.c index 2837ade..a3f938b 100644 --- a/tui_main.c +++ b/tui_main.c @@ -2234,6 +2234,7 @@ int main(int argc, char** argv) { } goto next_getch; } +#ifndef FEAT_NOMOUSE case KEY_MOUSE: { MEVENT mevent; if (cont_window && getmouse(&mevent) == OK) { @@ -2255,6 +2256,7 @@ int main(int argc, char** argv) { } goto next_getch; } +#endif case CTRL_PLUS('q'): goto quit; }