home *** CD-ROM | disk | FTP | other *** search
/ Unix System Administration Handbook 1997 October / usah_oct97.iso / news / nn.tar / nn-6.5.1 / keymap.h < prev    next >
C/C++ Source or Header  |  1995-04-29  |  6KB  |  155 lines

  1. /*
  2.  *    (c) Copyright 1990, Kim Fabricius Storm.  All rights reserved.
  3.  *
  4.  *    Keyboard (re)mapping
  5.  */
  6.  
  7. #ifndef _NN_KEYMAP_H
  8. #define _NN_KEYMAP_H 1
  9.  
  10. #define K_INVALID        0x0000 /* unknown command (for lookup) */
  11.  
  12. #define K_UNBOUND        0x0001 /* unbound command key         */
  13.  
  14. #define K_REDRAW        0x0002 /* redraw             */
  15. #define K_CONTINUE        0x0003 /* continue with next ...     */
  16. #define K_LAST_MESSAGE        0x0004 /* repeat last message         */
  17. #define K_HELP            0x0005 /* online help             */
  18. #define K_SHELL            0x0006 /* shell escape         */
  19. #define K_VERSION        0x0007 /* print version         */
  20. #define K_EXTENDED_CMD        0x0008 /* extended commands        */
  21.  
  22. #define K_QUIT            0x0009 /* quit             */
  23.  
  24. #define    K_BUG_REPORT        0x000a /* send bug report */
  25.  
  26. #define K_SAVE_NO_HEADER     0x0011 /* save articles without header */
  27. #define K_SAVE_SHORT_HEADER     0x0012 /* save article with short header */
  28. #define K_SAVE_FULL_HEADER     0x0013 /* save articles with full header */
  29.  
  30. #define K_PRINT            0x0014 /* print ariticle         */
  31.  
  32. #define K_UNSHAR        0x0015 /* unshar article        */
  33.  
  34. #define K_REPLY            0x0016 /* reply to article         */
  35. #define K_FOLLOW_UP        0x0017 /* follow up to article     */
  36. #define K_POST            0x0018 /* post an article        */
  37. #define K_MAIL_OR_FORWARD     0x0019 /* mail (forward article)     */
  38. #define K_CANCEL        0x001a /* cancel article         */
  39. #define K_UNSUBSCRIBE        0x001b /* (un)subscribe to group     */
  40. #define K_GROUP_OVERVIEW     0x001c /* group overview         */
  41. #define K_PATCH            0x001d /* pipe article to patch         */
  42. #define    K_UUDECODE        0x001e /* uudecode articles        */
  43.  
  44. #define K_GOTO_GROUP        0x001f /* goto named group/folder    */
  45.  
  46. #define K_KILL_HANDLING        0x0020 /* enter kill menu        */
  47.  
  48.     /* scrolling/menu movement */
  49.  
  50. #define K_CONTINUE_NO_MARK    0x0021 /* as continue but don't mark seen */
  51. #define K_JUNK_ARTICLES        0x0022 /* convert given attr to read    */
  52. #define K_SKIP_LINES        0x0023 /* skip lines of same type    */
  53. #define K_NEXT_PAGE        0x0024 /* next page             */
  54. #define K_NEXT_HALF_PAGE     0x0025 /* next half page        */
  55. #define K_NEXT_LINE        0x0026 /* next line            */
  56. #define K_PREV_PAGE        0x0027 /* previous page         */
  57. #define K_PREV_HALF_PAGE     0x0028 /* previous half page        */
  58. #define K_PREV_LINE        0x0029 /* previous line        */
  59.  
  60. #define K_HEADER_PAGE        0x002a /* first page incl. header    */
  61. #define K_FIRST_PAGE        0x002b /* first page             */
  62. #define K_LAST_PAGE        0x002c /* last page             */
  63.  
  64. #define K_GOTO_LINE        0x002d /* goto specific line        */
  65. #define K_GOTO_PAGE        0x002e /* goto specific page        */
  66. #define K_GOTO_MATCH        0x002f /* goto line matching regexp    */
  67. #define K_NEXT_MATCH        0x0030 /* find next match        */
  68.  
  69. #define K_PREVIOUS        0x0031 /* goto prev group or article    */
  70.                 /* (no update is performed)    */
  71.  
  72.     /* more() SPECIFIC COMMANDS */
  73.  
  74. #define K_LEAVE_ARTICLE        0x0032 /* goto next article, mark current */
  75. #define K_LEAVE_NEXT        0x0033 /* mark current for next time    */
  76. #define K_NEXT_ARTICLE        0x0034 /* goto next article         */
  77. #define K_NEXT_SUBJECT        0x0035 /* goto next subject        */
  78. #define K_FULL_DIGEST        0x0036 /* show full digest        */
  79. #define K_ROT13            0x0037 /* do rot13             */
  80. #define K_COMPRESS        0x0038 /* compress spaces        */
  81. #define K_BACK_TO_MENU        0x0039 /* return to menu */
  82. #define    K_BACK_ARTICLE        0x003a /* back one article        */
  83. #define    K_FORW_ARTICLE        0x003b /* forward one article        */
  84.  
  85.     /* menu() SPECIFIC COMMANDS     */
  86.  
  87. #define K_SELECT        0x0041 /* select current, move down     */
  88. #define K_SELECT_INVERT        0x0042 /* invert all selections     */
  89. #define K_SELECT_SUBJECT     0x0043 /* select all with same subject */
  90. #define K_SELECT_RANGE        0x0044 /* select range         */
  91. #define K_AUTO_SELECT        0x0045 /* auto select from kill file    */
  92. #define K_UNSELECT_ALL        0x0046 /* undo all selections        */
  93.  
  94. #define K_LAYOUT        0x0049 /* change menu layout         */
  95.  
  96. #define K_NEXT_GROUP_NO_UPDATE     0x004a /* goto next group, no update     */
  97. #define K_READ_GROUP_UPDATE     0x004b /* read selected, then next group */
  98. #define K_READ_GROUP_THEN_SAME    0x004c /* read selected, then same group */
  99.  
  100. #define K_ADVANCE_GROUP        0x004d /* advance one group in sequence */
  101. #define K_BACK_GROUP        0x004e /* back-up one group in sequence */
  102.  
  103. #define K_PREVIEW        0x004f /* preview article         */
  104.  
  105. #define K_OPEN_SUBJECT        0x0050 /* open subject on menu        */
  106. #define K_CLOSE_SUBJECT        0x0051 /* close subject on menu        */
  107.  
  108. #define K_M_TOGGLE        0x0060 /* page with mouse           */
  109. #define K_M_CONTINUE        0x0061 /* page with mouse           */
  110. #define K_M_SELECT        0x0062 /* select with mouse           */
  111. #define K_M_SELECT_SUBJECT    0x0063 /* select subject            */
  112. #define K_M_SELECT_RANGE    0x0064 /* used for draging a range         */
  113. #define K_M_PREVIEW        0x0065 /* preview articles             */
  114.  
  115. #define    K_EQUAL_KEY        0x0070 /* map command special symbol    */
  116.  
  117. #define    K_MACRO            0x0100 /* call macro            */
  118. #define    K_ARTICLE_ID        0x0200 /* article id in lower part    */
  119. #define K_PREFIX_KEY        0x0400 /* key map number in lower part    */
  120.  
  121. /* keymap definitions from keymap.c */
  122.  
  123. #define MULTI_KEYS    21
  124.  
  125. /* restrictions */
  126.  
  127. #define K_ONLY_MENU    0x0001
  128. #define K_ONLY_MORE    0x0002
  129. #define    K_BOTH_MAPS    0x0004    /* map flag: for "both" */
  130. #define    K_BIND_ORIG    0x0008    /* map flag: must maintain orig_menu_map */
  131. #define K_GLOBAL_KEY_MAP    0x0010    /* "key" */
  132. #define    K_MULTI_KEY_MAP        0x0020     /* "#..." */
  133.  
  134. typedef unsigned char key_type;
  135.  
  136. extern int menu_key_map[];
  137. extern int more_key_map[];
  138. extern int orig_menu_map[];
  139.  
  140. extern key_type global_key_map[];
  141.  
  142. extern char *key_name();
  143. extern key_type parse_key();
  144.  
  145. struct key_map_def {
  146.     char    *km_name;    /* key map name */
  147.     int        *km_map;    /* key map table */
  148.     
  149.     int        km_flag;    /* flags */
  150. };
  151.  
  152. extern struct key_map_def keymaps[];
  153.  
  154. #endif /* _NN_KEYMAP_H */
  155.