📄 inputline.h
字号:
#define MAX_PROMPT_BUF 80// History idstypedef enum {hi_none, hi_generic, hi_main_input, hi_open_mud, hi_search_scrollback} history_id;class InputHistorySelection;// Input line. This one handles displaying/editingclass InputLine : public Window {public: InputLine(Window *_parent, int _w, int _h, Style _style, int _x, int _y, history_id _id); virtual ~InputLine() {}; bool getline(char *buf, bool fForce); // Return true if there is a line available void set_prompt (const char *prompt); void set_default_prompt(); virtual void redraw(); virtual void set (const char *s); // Set the input line to this protected: virtual bool keypress(int key); virtual void execute() {}; // Called when data has been inputted protected: char input_buf[MAX_INPUT_BUF]; char prompt_buf[MAX_PROMPT_BUF]; int cursor_pos; // Where will the next character be inserted? int max_pos; // How many characters are there in the buffer? int left_pos; // What is the left position? bool ready; // The input line holds a finished string (hmm) history_id id; // ID for history saving int history_pos;// For cycling through history virtual void adjust(); // Adjust left_pos virtual bool isExpandable() {return false;} static void selection_callback(void *obj, const char *s, int no); friend class InputHistorySelection;};// This is mcl's main input lineclass MainInputLine : public InputLine {public: MainInputLine(); virtual void execute(); virtual void set (const char *s); // Set the input line to this virtual bool isExpandable() { return true; }};extern MainInputLine *inputLine;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -