Browse Source

adds --nomouse option when compiling

master
Nicola Pisanti 6 years ago
parent
commit
733ee3ae99
  1. 2
      README.md
  2. 7
      tool
  3. 2
      tui_main.c

2
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. 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 ### Make
```sh ```sh

7
tool

@ -30,6 +30,8 @@ Optional Features:
--portmidi Enable hardware MIDI output support with PortMIDI. --portmidi Enable hardware MIDI output support with PortMIDI.
Default: not enabled Default: not enabled
Note: PortMIDI has memory leaks and bugs. Note: PortMIDI has memory leaks and bugs.
--nomouse Disables mouse clicks.
Default: not enabled (mouse enabled).
EOF EOF
} }
@ -50,6 +52,7 @@ stats_enabled=0
pie_enabled=0 pie_enabled=0
static_enabled=0 static_enabled=0
portmidi_enabled=0 portmidi_enabled=0
mouse_disabled=0
while getopts c:dhsv-: opt_val; do while getopts c:dhsv-: opt_val; do
case "$opt_val" in case "$opt_val" in
@ -59,6 +62,7 @@ while getopts c:dhsv-: opt_val; do
static) static_enabled=1;; static) static_enabled=1;;
pie) pie_enabled=1;; pie) pie_enabled=1;;
portmidi) portmidi_enabled=1;; portmidi) portmidi_enabled=1;;
nomouse) mouse_disabled=1;;
*) *)
echo "Unknown long option --$OPTARG" >&2 echo "Unknown long option --$OPTARG" >&2
print_usage >&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 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
fi fi
if [[ $mouse_disabled = 1 ]]; then
add cc_flags -DFEAT_NOMOUSE
fi
;; ;;
esac esac
try_make_dir "$build_dir" try_make_dir "$build_dir"

2
tui_main.c

@ -2234,6 +2234,7 @@ int main(int argc, char** argv) {
} }
goto next_getch; goto next_getch;
} }
#ifndef FEAT_NOMOUSE
case KEY_MOUSE: { case KEY_MOUSE: {
MEVENT mevent; MEVENT mevent;
if (cont_window && getmouse(&mevent) == OK) { if (cont_window && getmouse(&mevent) == OK) {
@ -2255,6 +2256,7 @@ int main(int argc, char** argv) {
} }
goto next_getch; goto next_getch;
} }
#endif
case CTRL_PLUS('q'): case CTRL_PLUS('q'):
goto quit; goto quit;
} }

Loading…
Cancel
Save