📄 emul.h
字号:
/* emul.h
* Copyright (c) 1997 David Cole
*
* Terminal emulation
*/
#ifndef __emul_h
#define __emul_h
#include "ctab.h"
/* Define key sequences for a terminal emulation
*/
#define MAX_F_KEY 20
#define ETF_ESC_PARO 3 /* how to handle "\E(" sequences */
#define ETF_ESC_PARO_LINUX 1 /* like LINUX */
#define ETF_ESC_PARO_VT320 2 /* like VT320+ */
#define ETF_MOUSE_EVENT 4 /* does the terminal support mouse ev */
#define TERM_NAME_LEN 20
#define KEYCODE_LEN 8
typedef char KEYCODE[KEYCODE_LEN];
typedef struct {
char name[TERM_NAME_LEN]; /* name of terminal type */
int flags; /* ETF_... */
KEYCODE keyPageUp; /* string to send for PageUp key */
KEYCODE keyPageDown;
KEYCODE keyHome;
KEYCODE keyEnd;
KEYCODE keyInsert;
KEYCODE keyDelete;
KEYCODE keyBacktab;
KEYCODE keyBackSpace; /* Standard BackSpace */
KEYCODE keyAltBackSpace; /* Alternate BackSpace */
int nMaxFkey; /* Should be less or equal to MAX_F_KEY */
KEYCODE keyF[MAX_F_KEY]; /* keyF[0]=F1.. keyF[19]=F20 */
CodeTable ctGraphConv; /* map graphics characters to vt100 std */
CodeTable ctServerToOem; /* map characters coming from server */
CodeTable ctOemToServer; /* map characters going to server */
CodeTable ctServerToAnsi; /* map characters coming from server */
CodeTable ctAnsiToServer; /* map ANSI codes to server charset */
BOOL fAnsi; /* true if ANSI (any variant) */
} Emul;
typedef struct {
unsigned int num;
char** names;
} EmulNames;
/* Functions to access terminal definitions */
void telnetEnumTermProfiles(EmulNames* emuls);
void telnetGetTermProfile(Emul* emul, const char* name);
void telnetSaveTermProfile(Emul* emul, char* name);
/* Return pointer to terminal currently being emulated. */
Emul* emulGetTerm(void);
/* Set the terminal type to emulate by name */
void emulSetTerm(const char* name);
/* Set the from/to server charsets specified by name */
void emulSetCharset(const char *name);
/* Return current character attributes */
unsigned char getCurrAttr(void);
/* Process a stream of characters through terminal emulator */
void emulAddText(unsigned char* text, int len, BOOL bKeyboard);
/* Handle a normal key press */
void emulKeyPress(char ch);
/* Handle a function key press */
void emulFuncKeyPress(char* str);
/* Handle a function key press local/remote*/
void emulFuncKeyPress2(int localaction, char *str);
/* how to do local echoing */
#define EFK_LOCAL_SKIP 0 /* do nothing */
#define EFK_LOCAL_SAME 1 /* echo the same str */
#define EFK_LOCAL_BACKSPACE 2 /* delete charcter left to the cursor */
#define EFK_LOCAL_DELETE 3 /* delete charcter under the cursor */
#define EFK_LOCAL_INSERT 4 /* switch insert mode */
#define EFK_LOCAL_LEFT 5 /* cursor left */
#define EFK_LOCAL_RIGHT 6 /* cursor right */
#define EFK_LOCAL_HOME 7 /* cursor to begging of line */
#define EFK_LOCAL_END 8 /* cursor to end of line */
#define EFK_LOCAL_SEND 9 /* send in the current line */
/* Set terminal local echo mode on or off */
void emulSetEcho(BOOL echo);
/* Set terminal local flow control "resume with any character" on or off */
void emulLocalFlowAny(BOOL any);
/* Reset terminal to initial state */
void emulResetTerminal(void);
/* Define AnswerBack message */
void emulSetAnswerBack (int len, const char *from);
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -