Implement activate_mouse_input and suspend_mouse_input for MouseTerminal
Fixes #200
RawTerminal
has the methods suspend_raw_mode
and activate_raw_mode
for forcing suspending and activating of raw mode, which can be useful in some situations.
In the same situations where suspending and activating raw mode are useful, it's as useful to be able to activate and suspend mouse inputs programmatically (think for example temporarily suspending the current app with the SIGTSTP signal, and resuming it with the SIGCONT signal: it would be great to suspend the mouse input before handling SIGTSTP, and activate the mouse input when handling SIGCONT). Another useful example for wanting this is: Imagine having a TUI app that uses Termion, and temporarily executes another command line app. Before executing the other command line app, it's better to suspend the mouse input, and activate it back after the other app has completed.
This PR allows suspending and activating the mouse input in 2 ways:
- MouseTerminal now provides the
suspend_mouse_input
andactivate_mouse_input
methods - The
input
module provides theStartMouseInput
andStopMouseInput
structs, that can be used the same way as theToAlternateScreen
andToMainScreen
structs