KBDINPUT.LST 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. Listing:
  2. 1 IMPLEMENTATION MODULE KbdInput;
  3. 2 (*
  4. 3 * REPERTOIRE
  5. 4 * Release 1.6
  6. 5 * By Charles Bradford and Cole Brecheen
  7. 6 * (c) Copyright 1985-1992 PMI
  8. 7 * Green Bay, Wisconsin
  9. 8 * All rights reserved
  10. 9 * (414) 468-6040
  11. 10 *
  12. 11 * $Header: D:/logfiles/mods/kbdinput.mov 1.8 17 Mar 1991 17:56:26 coleb $
  13. 12 *
  14. 13 *)
  15. 14
  16. 15
  17. 16 IMPORT BigSets;
  18. 17 IMPORT ErrorManager;
  19. 18 IMPORT FAPI;
  20. 19 IMPORT LowLevel;
  21. 20 IMPORT M2Strings;
  22. 21 IMPORT StrConv;
  23. 22 IMPORT StrEdit;
  24. 23 IMPORT StringIO;
  25. 24 IMPORT SYSTEM;
  26. 25
  27. 26 VAR
  28. 27 Initialized : BOOLEAN;
  29. 28
  30. 29 VAR
  31. 30 KbdState: FAPI.KBDINFO;
  32. ***** ^ not supported yet
  33. 31
  34. 32
  35. 33 PROCEDURE DefaultKeyHit( LegalKeys: KeyNumSet ): CARDINAL;
  36. ***** ^ undeclared identifier
  37. 34 VAR
  38. 35 CharData: FAPI.KBDKEYINFO;
  39. ***** ^ not supported yet
  40. 36 bufch: CHAR;
  41. 37 TmpResult: CARDINAL;
  42. 38 BEGIN
  43. 39 REPEAT
  44. 40 IF NOT TypeAheadLegal THEN
  45. ***** ^ undeclared identifier
  46. 41 TmpResult:=FAPI.KBDFLUSHBUFFER(0)
  47. ***** ^ not supported yet
  48. ***** ^ not supported yet
  49. ***** ^ not supported yet
  50. 42 END;
  51. 43
  52. 44 IF FAPI.KBDCHARIN(SYSTEM.ADR(CharData), 0, 0) # 0 THEN
  53. ***** ^ not supported yet
  54. ***** ^ not supported yet
  55. ***** ^ not supported yet
  56. ***** ^ not supported yet
  57. ***** ^ not supported yet
  58. ***** ^ not supported yet
  59. 45 ErrorManager.WARN( "KBDCHARIN");
  60. ***** ^ not supported yet
  61. ***** ^ not supported yet
  62. ***** ^ not supported yet
  63. 46 END;
  64. 47 IF (CharData.chChar = FAPI.UCHAR(0C)) OR
  65. ***** ^ not supported yet
  66. ***** ^ not supported yet
  67. ***** ^ not supported yet
  68. ***** ^ not supported yet
  69. ***** ^ not supported yet
  70. 48 (CharData.chChar = FAPI.UCHAR(CHR(0E0H))) THEN
  71. ***** ^ not supported yet
  72. ***** ^ not supported yet
  73. ***** ^ not supported yet
  74. ***** ^ not supported yet
  75. ***** ^ undeclared identifier
  76. ***** ^ not supported yet
  77. 49 TmpResult := ORD(CharData.chScan) + Extended;
  78. ***** ^ undeclared identifier
  79. ***** ^ not supported yet
  80. ***** ^ not supported yet
  81. ***** ^ undeclared identifier
  82. 50 ELSE
  83. 51 TmpResult := ORD(CharData.chChar);
  84. ***** ^ undeclared identifier
  85. ***** ^ not supported yet
  86. ***** ^ not supported yet
  87. 52 END;
  88. 53 UNTIL BigSets.InSet(LegalKeys, TmpResult);
  89. ***** ^ not supported yet
  90. ***** ^ not supported yet
  91. ***** ^ not supported yet
  92. ***** ^ not supported yet
  93. 54 RETURN(TmpResult);
  94. 55 END DefaultKeyHit;
  95. ***** ^ not supported yet
  96. 56
  97. 57
  98. 58 PROCEDURE CAPkey( KeyNum: CARDINAL ): CARDINAL;
  99. 59 (*This routine serves the same function for numeric key
  100. 60 values that CAP serves for ASCII values.*)
  101. 61 BEGIN
  102. 62 IF (KeyNum >= 97) (*ORD('a')*)
  103. 63 AND (KeyNum <= 122) (*ORD('z')*) THEN
  104. 64 RETURN KeyNum - 32; (*ORD('a') - ORD('A')*)
  105. 65 ELSE
  106. 66 RETURN KeyNum;
  107. 67 END;
  108. 68 END CAPkey;
  109. ***** ^ not supported yet
  110. 69
  111. 70
  112. 71 PROCEDURE ReassignKey(KeyCode : CARDINAL; NewDefn :
  113. 72 ARRAY OF CHAR);
  114. ***** ^ not supported yet
  115. 73 BEGIN
  116. 74 END ReassignKey;
  117. ***** ^ not supported yet
  118. 75
  119. 76
  120. 77 PROCEDURE Init();
  121. 78 BEGIN
  122. 79 IF Initialized THEN
  123. 80 RETURN;
  124. 81 ELSE
  125. 82 Initialized := TRUE;
  126. 83 END;
  127. 84
  128. 85 BigSets.Init();
  129. ***** ^ not supported yet
  130. ***** ^ not supported yet
  131. ***** ^ not supported yet
  132. 86 ErrorManager.Init();
  133. ***** ^ not supported yet
  134. ***** ^ not supported yet
  135. ***** ^ not supported yet
  136. 87 LowLevel.Init();
  137. ***** ^ not supported yet
  138. ***** ^ not supported yet
  139. ***** ^ not supported yet
  140. 88 M2Strings.Init();
  141. ***** ^ not supported yet
  142. ***** ^ not supported yet
  143. ***** ^ not supported yet
  144. 89 StrConv.Init();
  145. ***** ^ not supported yet
  146. ***** ^ not supported yet
  147. ***** ^ not supported yet
  148. 90 StrEdit.Init();
  149. ***** ^ not supported yet
  150. ***** ^ not supported yet
  151. ***** ^ not supported yet
  152. 91 StringIO.Init();
  153. ***** ^ not supported yet
  154. ***** ^ not supported yet
  155. ***** ^ not supported yet
  156. 92
  157. 93 (*EntryDiag:
  158. 94 StringIO.WriteEol( 1, 'Entering KbdInput' );
  159. 95 :EntryDiag*)
  160. 96
  161. 97 KeyHit := DefaultKeyHit;
  162. ***** ^ undeclared identifier
  163. ***** ^ not supported yet
  164. 98 TypeAheadLegal := TRUE;
  165. ***** ^ undeclared identifier
  166. 99 BigSets.InitSet( AnyKeyNum );
  167. ***** ^ not supported yet
  168. ***** ^ not supported yet
  169. ***** ^ undeclared identifier
  170. 100 BigSets.AppendSet( AnyKeyNum, "{0..400}" );
  171. ***** ^ not supported yet
  172. ***** ^ not supported yet
  173. ***** ^ undeclared identifier
  174. ***** ^ not supported yet
  175. 101 BigSets.InitSet( YorN );
  176. ***** ^ not supported yet
  177. ***** ^ not supported yet
  178. ***** ^ undeclared identifier
  179. 102 BigSets.AppendSet( YorN, "{'y', 'Y', 'n', 'N'}" );
  180. ***** ^ not supported yet
  181. ***** ^ not supported yet
  182. ***** ^ undeclared identifier
  183. ***** ^ not supported yet
  184. 103
  185. 104 KbdState.cb := SYSTEM.TSIZE(FAPI.KBDINFO);
  186. ***** ^ not supported yet
  187. ***** ^ not supported yet
  188. ***** ^ not supported yet
  189. ***** ^ not supported yet
  190. ***** ^ not supported yet
  191. ***** ^ not supported yet
  192. 105 KbdState.fsMask := FAPI.KEYBOARD_BINARY_MODE;
  193. ***** ^ not supported yet
  194. ***** ^ not supported yet
  195. ***** ^ not supported yet
  196. ***** ^ not supported yet
  197. 106 IF FAPI.KBDSETSTATUS(SYSTEM.ADR(KbdState), 0) # 0 THEN
  198. ***** ^ not supported yet
  199. ***** ^ not supported yet
  200. ***** ^ not supported yet
  201. ***** ^ not supported yet
  202. ***** ^ not supported yet
  203. ***** ^ not supported yet
  204. 107 ErrorManager.WARN("KBDSETSTATUS");
  205. ***** ^ not supported yet
  206. ***** ^ not supported yet
  207. ***** ^ not supported yet
  208. 108 END;
  209. 109
  210. 110 (*EntryDiag:
  211. 111 StringIO.WriteEol( 1, 'Exiting KbdInput' );
  212. 112 :EntryDiag*)
  213. 113 END Init;
  214. ***** ^ not supported yet
  215. 114
  216. 115
  217. 116 BEGIN
  218. 117 Initialized := FALSE;
  219. 118 Init();
  220. ***** ^ not supported yet
  221. ***** ^ not supported yet
  222. 119 END KbdInput.
  223. ***** ^ not supported yet
  224. 103 errors