/*- * Copyright (c) 2002 Jordan DeLong * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the author nor the names of contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef INPUT_H #define INPUT_H /* * core key identifier definitions */ enum { /* basic keys */ KEYSYM_NOP = SCREEN_FIRSTUSRSYM, KEYSYM_UP, KEYSYM_DOWN, KEYSYM_LEFT, KEYSYM_RIGHT, KEYSYM_PGUP, KEYSYM_PGDN, KEYSYM_HOME, KEYSYM_END, KEYSYM_BACKSPACE, KEYSYM_DELETE, KEYSYM_ENTER, /* main keys */ KEYSYM_QUIT, KEYSYM_SUSPEND, KEYSYM_CANCEL, KEYSYM_EXCMD, KEYSYM_HASHSTATS, KEYSYM_SAVEBUFFERS, KEYSYM_SWITCHBUFF, KEYSYM_SETOPT, KEYSYM_OPENFILE, KEYSYM_SAVE, KEYSYM_SAVEAS, KEYSYM_REDRAW, KEYSYM_QUOTENEXT, KEYSYM_AGAIN, KEYSYM_VIEWCYCLE, KEYSYM_PUSHVIEW, KEYSYM_POPVIEW, KEYSYM_VERTSPLIT, KEYSYM_HORIZSPLIT, KEYSYM_RMVIEW, KEYSYM_RMOTHERVIEWS, KEYSYM_VERTGROW, KEYSYM_VERTSHRINK, KEYSYM_HORIZGROW, KEYSYM_HORIZSHRINK, KEYSYM_FRAMECYCLE, KEYSYM_NEWFRAME, KEYSYM_RMFRAME, /* macro keys */ KEYSYM_RECORD, KEYSYM_PLAYBACK, KEYSYM_REPEAT, /* editing keys supported from the vdefault layer */ KEYSYM_OPENLINE, KEYSYM_TOGNLSTYLE, KEYSYM_UNDO, KEYSYM_REDO, KEYSYM_NEXTWORD, KEYSYM_PREVWORD, KEYSYM_NEXTPARA, KEYSYM_PREVPARA, KEYSYM_VIEWTOP, KEYSYM_VIEWBOTTOM, KEYSYM_LINEUP, KEYSYM_LINEDN, KEYSYM_FIRSTLINE, KEYSYM_LASTLINE, KEYSYM_HALFPGUP, KEYSYM_HALFPGDN, KEYSYM_CENTER, KEYSYM_TRANCHARS, KEYSYM_TRANWORDS, KEYSYM_TRANLINES, KEYSYM_SETMARK, KEYSYM_POPMARK, KEYSYM_PROMOTEMARK, KEYSYM_DEMOTEMARK, KEYSYM_XCHGMARK, KEYSYM_KILLRGN, KEYSYM_KILLLINE, KEYSYM_KILLEOL, KEYSYM_KILLWORD, KEYSYM_FWDKILLWORD, KEYSYM_APPENDKILL, KEYSYM_YANK, KEYSYM_YANKPOP, KEYSYM_FWDYANKPOP, KEYSYM_ISEARCH, KEYSYM_RISEARCH, KEYSYM_GOTOLN, KEYSYM_REPLACE, KEYSYM_FILTER, KEYSYM_INSERTFILE, /* first keysym for runtime allocation by views */ KEYSYM_FIRSTVIEWSYM }; extern int input_exitloop; extern int input_lastkeysym; extern int input_nodraw; void input_init(); int input_allocsyms(int count); int input_getkey(); int input_key_pending(int m); int input_isctrl(int keysym); void input_default_handler(viewhdr_t *, int keysym); void input_dispatch(int keysym); void input_loop(); void input_begincancel(); int input_checkcancel(); void input_endcancel(); /* * used for recursive entry into the input loop; this is used * for things like entering the minibuffer. */ static __inline void input_recurse() { input_loop(); input_exitloop = 0; } #endif