/* Copyright (C) 2008 Emmanuel Varoquaux This file is part of XOS. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef INPUT_H #define INPUT_H enum { /* Moving */ CM_MOVE_START, /* C-a */ CM_MOVE_END, /* C-e */ CM_MOVE_FW_CHAR, /* C-f */ CM_MOVE_BW_CHAR, /* C-b */ CM_MOVE_FW_WORD, /* M-f */ CM_MOVE_BW_WORD, /* M-b */ CM_CLEAR_SCREEN, /* C-l */ CM_REFRESH_LINE, /* C-x r */ /* History */ CM_ACCEPT_LINE, /* Newline, Return */ CM_PREV_HIST, /* C-p */ CM_NEXT_HIST, /* C-n */ CM_BEGIN_HIST, /* M-< */ CM_END_HIST, /* M-> */ /* Changing Text */ CM_DELETE_CHAR, /* C-d */ CM_BW_DELETE_CHAR, /* DEL, Backspace */ CM_INSERT_CHAR, /* Printing character */ CM_TOOGLE_OVWRT_MODE, /* Killing */ CM_KILL_LINE, /* C-k */ CM_BW_KILL_LINE, /* C-u, M-DEL */ CM_KILL_WORD, /* M-d */ CM_BW_KILL_WORD, /* M-DEL */ CM_BW_KILL_WORD_WSP, /* C-w */ CM_YANK, /* C-y */ CM_YANK_POP, /* M-y */ /* Miscellaneous */ CM_REVERT_LINE, /* M-r */ CM_SET_MARK, /* C-@, M-SPACE */ CM_EXCHANGE_POINT_AND_MARK, /* C-x C-x */ /* divers */ CM_INTERRUPT, /* C-c */ CM_EOF }; #define make_cmd(name) (name) #define make_cmd_char(name, c) (name | (c) << 8) #define cmd_get_name(cmd) ((cmd) & 0xff) #define cmd_get_char(cmd) ((cmd) >> 8) int read_cmd(); #endif