2015-10-25 14:27:32 +00:00
|
|
|
package com.termux.view;
|
|
|
|
|
2016-06-27 22:56:30 +00:00
|
|
|
import android.view.KeyEvent;
|
2015-10-25 14:27:32 +00:00
|
|
|
import android.view.MotionEvent;
|
|
|
|
import android.view.ScaleGestureDetector;
|
|
|
|
|
2016-06-27 22:56:30 +00:00
|
|
|
import com.termux.terminal.TerminalSession;
|
|
|
|
|
2015-10-25 14:27:32 +00:00
|
|
|
/**
|
|
|
|
* Input and scale listener which may be set on a {@link TerminalView} through
|
2017-04-02 12:25:34 +00:00
|
|
|
* {@link TerminalView#setOnKeyListener(TerminalViewClient)}.
|
2016-06-27 23:03:03 +00:00
|
|
|
* <p/>
|
2015-10-25 14:27:32 +00:00
|
|
|
*/
|
2017-04-02 12:25:34 +00:00
|
|
|
public interface TerminalViewClient {
|
2015-10-25 14:27:32 +00:00
|
|
|
|
2017-04-01 17:06:02 +00:00
|
|
|
/**
|
|
|
|
* Callback function on scale events according to {@link ScaleGestureDetector#getScaleFactor()}.
|
|
|
|
*/
|
2016-06-27 23:03:03 +00:00
|
|
|
float onScale(float scale);
|
2015-10-25 14:27:32 +00:00
|
|
|
|
2017-04-01 17:06:02 +00:00
|
|
|
/**
|
|
|
|
* On a single tap on the terminal if terminal mouse reporting not enabled.
|
|
|
|
*/
|
2016-06-27 23:03:03 +00:00
|
|
|
void onSingleTapUp(MotionEvent e);
|
2015-10-25 14:27:32 +00:00
|
|
|
|
2016-06-27 23:03:03 +00:00
|
|
|
boolean shouldBackButtonBeMappedToEscape();
|
2015-12-23 00:43:41 +00:00
|
|
|
|
2021-03-11 16:06:42 +00:00
|
|
|
boolean shouldEnforeCharBasedInput();
|
|
|
|
|
|
|
|
boolean shouldUseCtrlSpaceWorkaround();
|
|
|
|
|
2016-06-27 23:03:03 +00:00
|
|
|
void copyModeChanged(boolean copyMode);
|
2016-01-13 02:00:21 +00:00
|
|
|
|
2016-06-27 22:56:30 +00:00
|
|
|
boolean onKeyDown(int keyCode, KeyEvent e, TerminalSession session);
|
|
|
|
|
|
|
|
boolean onKeyUp(int keyCode, KeyEvent e);
|
|
|
|
|
|
|
|
boolean readControlKey();
|
|
|
|
|
|
|
|
boolean readAltKey();
|
|
|
|
|
|
|
|
boolean onCodePoint(int codePoint, boolean ctrlDown, TerminalSession session);
|
|
|
|
|
2017-04-01 17:06:02 +00:00
|
|
|
boolean onLongPress(MotionEvent event);
|
|
|
|
|
2015-10-25 14:27:32 +00:00
|
|
|
}
|