atarikbd.txt 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709
  1. Intelligent Keyboard (ikbd) Protocol
  2. 1. Introduction
  3. The Atari Corp. Intelligent Keyboard (ikbd) is a general purpose keyboard
  4. controller that is flexible enough that it can be used in a variety of
  5. products without modification. The keyboard, with its microcontroller,
  6. provides a convenient connection point for a mouse and switch-type joysticks.
  7. The ikbd processor also maintains a time-of-day clock with one second
  8. resolution.
  9. The ikbd has been designed to be general enough that it can be used with a
  10. variety of new computer products. Product variations in a number of
  11. keyswitches, mouse resolution, etc. can be accommodated.
  12. The ikbd communicates with the main processor over a high speed bi-directional
  13. serial interface. It can function in a variety of modes to facilitate
  14. different applications of the keyboard, joysticks, or mouse. Limited use of
  15. the controller is possible in applications in which only a unidirectional
  16. communications medium is available by carefully designing the default modes.
  17. 3. Keyboard
  18. The keyboard always returns key make/break scan codes. The ikbd generates
  19. keyboard scan codes for each key press and release. The key scan make (key
  20. closure) codes start at 1, and are defined in Appendix A. For example, the
  21. ISO key position in the scan code table should exist even if no keyswitch
  22. exists in that position on a particular keyboard. The break code for each key
  23. is obtained by ORing 0x80 with the make code.
  24. The special codes 0xF6 through 0xFF are reserved for use as follows:
  25. 0xF6 status report
  26. 0xF7 absolute mouse position record
  27. 0xF8-0xFB relative mouse position records (lsbs determined by
  28. mouse button states)
  29. 0xFC time-of-day
  30. 0xFD joystick report (both sticks)
  31. 0xFE joystick 0 event
  32. 0xFF joystick 1 event
  33. The two shift keys return different scan codes in this mode. The ENTER key
  34. and the RETurn key are also distinct.
  35. 4. Mouse
  36. The mouse port should be capable of supporting a mouse with resolution of
  37. approximately 200 counts (phase changes or 'clicks') per inch of travel. The
  38. mouse should be scanned at a rate that will permit accurate tracking at
  39. velocities up to 10 inches per second.
  40. The ikbd can report mouse motion in three distinctly different ways. It can
  41. report relative motion, absolute motion in a coordinate system maintained
  42. within the ikbd, or by converting mouse motion into keyboard cursor control
  43. key equivalents.
  44. The mouse buttons can be treated as part of the mouse or as additional
  45. keyboard keys.
  46. 4.1 Relative Position Reporting
  47. In relative position mode, the ikbd will return relative mouse position
  48. records whenever a mouse event occurs. A mouse event consists of a mouse
  49. button being pressed or released, or motion in either axis exceeding a
  50. settable threshold of motion. Regardless of the threshold, all bits of
  51. resolution are returned to the host computer.
  52. Note that the ikbd may return mouse relative position reports with
  53. significantly more than the threshold delta x or y. This may happen since no
  54. relative mouse motion events will be generated: (a) while the keyboard has
  55. been 'paused' ( the event will be stored until keyboard communications is
  56. resumed) (b) while any event is being transmitted.
  57. The relative mouse position record is a three byte record of the form
  58. (regardless of keyboard mode):
  59. %111110xy ; mouse position record flag
  60. ; where y is the right button state
  61. ; and x is the left button state
  62. X ; delta x as twos complement integer
  63. Y ; delta y as twos complement integer
  64. Note that the value of the button state bits should be valid even if the
  65. MOUSE BUTTON ACTION has set the buttons to act like part of the keyboard.
  66. If the accumulated motion before the report packet is generated exceeds the
  67. +127...-128 range, the motion is broken into multiple packets.
  68. Note that the sign of the delta y reported is a function of the Y origin
  69. selected.
  70. 4.2 Absolute Position reporting
  71. The ikbd can also maintain absolute mouse position. Commands exist for
  72. resetting the mouse position, setting X/Y scaling, and interrogating the
  73. current mouse position.
  74. 4.3 Mouse Cursor Key Mode
  75. The ikbd can translate mouse motion into the equivalent cursor keystrokes.
  76. The number of mouse clicks per keystroke is independently programmable in
  77. each axis. The ikbd internally maintains mouse motion information to the
  78. highest resolution available, and merely generates a pair of cursor key events
  79. for each multiple of the scale factor.
  80. Mouse motion produces the cursor key make code immediately followed by the
  81. break code for the appropriate cursor key. The mouse buttons produce scan
  82. codes above those normally assigned for the largest envisioned keyboard (i.e.
  83. LEFT=0x74 & RIGHT=0x75).
  84. 5. Joystick
  85. 5.1 Joystick Event Reporting
  86. In this mode, the ikbd generates a record whenever the joystick position is
  87. changed (i.e. for each opening or closing of a joystick switch or trigger).
  88. The joystick event record is two bytes of the form:
  89. %1111111x ; Joystick event marker
  90. ; where x is Joystick 0 or 1
  91. %x000yyyy ; where yyyy is the stick position
  92. ; and x is the trigger
  93. 5.2 Joystick Interrogation
  94. The current state of the joystick ports may be interrogated at any time in
  95. this mode by sending an 'Interrogate Joystick' command to the ikbd.
  96. The ikbd response to joystick interrogation is a three byte report of the form
  97. 0xFD ; joystick report header
  98. %x000yyyy ; Joystick 0
  99. %x000yyyy ; Joystick 1
  100. ; where x is the trigger
  101. ; and yyy is the stick position
  102. 5.3 Joystick Monitoring
  103. A mode is available that devotes nearly all of the keyboard communications
  104. time to reporting the state of the joystick ports at a user specifiable rate.
  105. It remains in this mode until reset or commanded into another mode. The PAUSE
  106. command in this mode not only stop the output but also temporarily stops
  107. scanning the joysticks (samples are not queued).
  108. 5.4 Fire Button Monitoring
  109. A mode is provided to permit monitoring a single input bit at a high rate. In
  110. this mode the ikbd monitors the state of the Joystick 1 fire button at the
  111. maximum rate permitted by the serial communication channel. The data is packed
  112. 8 bits per byte for transmission to the host. The ikbd remains in this mode
  113. until reset or commanded into another mode. The PAUSE command in this mode not
  114. only stops the output but also temporarily stops scanning the button (samples
  115. are not queued).
  116. 5.5 Joystick Key Code Mode
  117. The ikbd may be commanded to translate the use of either joystick into the
  118. equivalent cursor control keystroke(s). The ikbd provides a single breakpoint
  119. velocity joystick cursor.
  120. Joystick events produce the make code, immediately followed by the break code
  121. for the appropriate cursor motion keys. The trigger or fire buttons of the
  122. joysticks produce pseudo key scan codes above those used by the largest key
  123. matrix envisioned (i.e. JOYSTICK0=0x74, JOYSTICK1=0x75).
  124. 6. Time-of-Day Clock
  125. The ikbd also maintains a time-of-day clock for the system. Commands are
  126. available to set and interrogate the timer-of-day clock. Time-keeping is
  127. maintained down to a resolution of one second.
  128. 7. Status Inquiries
  129. The current state of ikbd modes and parameters may be found by sending status
  130. inquiry commands that correspond to the ikbd set commands.
  131. 8. Power-Up Mode
  132. The keyboard controller will perform a simple self-test on power-up to detect
  133. major controller faults (ROM checksum and RAM test) and such things as stuck
  134. keys. Any keys down at power-up are presumed to be stuck, and their BREAK
  135. (sic) code is returned (which without the preceding MAKE code is a flag for a
  136. keyboard error). If the controller self-test completes without error, the code
  137. 0xF0 is returned. (This code will be used to indicate the version/rlease of
  138. the ikbd controller. The first release of the ikbd is version 0xF0, should
  139. there be a second release it will be 0xF1, and so on.)
  140. The ikbd defaults to a mouse position reporting with threshold of 1 unit in
  141. either axis and the Y=0 origin at the top of the screen, and joystick event
  142. reporting mode for joystick 1, with both buttons being logically assigned to
  143. the mouse. After any joystick command, the ikbd assumes that joysticks are
  144. connected to both Joystick0 and Joystick1. Any mouse command (except MOUSE
  145. DISABLE) then causes port 0 to again be scanned as if it were a mouse, and
  146. both buttons are logically connected to it. If a mouse diable command is
  147. received while port 0 is presumed to be a mouse, the button is logically
  148. assigned to Joystick1 ( until the mouse is reenabled by another mouse command).
  149. 9. ikbd Command Set
  150. This section contains a list of commands that can be sent to the ikbd. Command
  151. codes (such as 0x00) which are not specified should perform no operation
  152. (NOPs).
  153. 9.1 RESET
  154. 0x80
  155. 0x01
  156. N.B. The RESET command is the only two byte command understood by the ikbd.
  157. Any byte following an 0x80 command byte other than 0x01 is ignored (and causes
  158. the 0x80 to be ignored).
  159. A reset may also be caused by sending a break lasting at least 200mS to the
  160. ikbd.
  161. Executing the RESET command returns the keyboard to its default (power-up)
  162. mode and parameter settings. It does not affect the time-of-day clock.
  163. The RESET command or function causes the ikbd to perform a simple self-test.
  164. If the test is successful, the ikbd will send the code of 0xF0 within 300mS
  165. of receipt of the RESET command (or the end of the break, or power-up). The
  166. ikbd will then scan the key matrix for any stuck (closed) keys. Any keys found
  167. closed will cause the break scan code to be generated (the break code arriving
  168. without being preceded by the make code is a flag for a key matrix error).
  169. 9.2. SET MOUSE BUTTON ACTION
  170. 0x07
  171. %00000mss ; mouse button action
  172. ; (m is presumed = 1 when in MOUSE KEYCODE mode)
  173. ; mss=0xy, mouse button press or release causes mouse
  174. ; position report
  175. ; where y=1, mouse key press causes absolute report
  176. ; and x=1, mouse key release causes absolute report
  177. ; mss=100, mouse buttons act like keys
  178. This command sets how the ikbd should treat the buttons on the mouse. The
  179. default mouse button action mode is %00000000, the buttons are treated as part
  180. of the mouse logically.
  181. When buttons act like keys, LEFT=0x74 & RIGHT=0x75.
  182. 9.3 SET RELATIVE MOUSE POSITION REPORTING
  183. 0x08
  184. Set relative mouse position reporting. (DEFAULT) Mouse position packets are
  185. generated asynchronously by the ikbd whenever motion exceeds the setable
  186. threshold in either axis (see SET MOUSE THRESHOLD). Depending upon the mouse
  187. key mode, mouse position reports may also be generated when either mouse
  188. button is pressed or released. Otherwise the mouse buttons behave as if they
  189. were keyboard keys.
  190. 9.4 SET ABSOLUTE MOUSE POSITIONING
  191. 0x09
  192. XMSB ; X maximum (in scaled mouse clicks)
  193. XLSB
  194. YMSB ; Y maximum (in scaled mouse clicks)
  195. YLSB
  196. Set absolute mouse position maintenance. Resets the ikbd maintained X and Y
  197. coordinates.
  198. In this mode, the value of the internally maintained coordinates does NOT wrap
  199. between 0 and large positive numbers. Excess motion below 0 is ignored. The
  200. command sets the maximum positive value that can be attained in the scaled
  201. coordinate system. Motion beyond that value is also ignored.
  202. 9.5 SET MOUSE KEYCODE MOSE
  203. 0x0A
  204. deltax ; distance in X clicks to return (LEFT) or (RIGHT)
  205. deltay ; distance in Y clicks to return (UP) or (DOWN)
  206. Set mouse monitoring routines to return cursor motion keycodes instead of
  207. either RELATIVE or ABSOLUTE motion records. The ikbd returns the appropriate
  208. cursor keycode after mouse travel exceeding the user specified deltas in
  209. either axis. When the keyboard is in key scan code mode, mouse motion will
  210. cause the make code immediately followed by the break code. Note that this
  211. command is not affected by the mouse motion origin.
  212. 9..6 SET MOUSE THRESHOLD
  213. 0x0B
  214. X ; x threshold in mouse ticks (positive integers)
  215. Y ; y threshold in mouse ticks (positive integers)
  216. This command sets the threshold before a mouse event is generated. Note that
  217. it does NOT affect the resolution of the data returned to the host. This
  218. command is valid only in RELATIVE MOUSE POSITIONING mode. The thresholds
  219. default to 1 at RESET (or power-up).
  220. 9.7 SET MOUSE SCALE
  221. 0x0C
  222. X ; horizontal mouse ticks per internal X
  223. Y ; vertical mouse ticks per internal Y
  224. This command sets the scale factor for the ABSOLUTE MOUSE POSITIONING mode.
  225. In this mode, the specified number of mouse phase changes ('clicks') must
  226. occur before the internally maintained coordinate is changed by one
  227. (independently scaled for each axis). Remember that the mouse position
  228. information is available only by interrogating the ikbd in the ABSOLUTE MOUSE
  229. POSITIONING mode unless the ikbd has been commanded to report on button press
  230. or release (see SET MOSE BUTTON ACTION).
  231. 9.8 INTERROGATE MOUSE POSITION
  232. 0x0D
  233. Returns:
  234. 0xF7 ; absolute mouse position header
  235. BUTTONS
  236. 0000dcba ; where a is right button down since last interrogation
  237. ; b is right button up since last
  238. ; c is left button down since last
  239. ; d is left button up since last
  240. XMSB ; X coordinate
  241. XLSB
  242. YMSB ; Y coordinate
  243. YLSB
  244. The INTERROGATE MOUSE POSITION command is valid when in the ABSOLUTE MOUSE
  245. POSITIONING mode, regardless of the setting of the MOUSE BUTTON ACTION.
  246. 9.9 LOAD MOUSE POSITION
  247. 0x0E
  248. 0x00 ; filler
  249. XMSB ; X coordinate
  250. XLSB ; (in scaled coordinate system)
  251. YMSB ; Y coordinate
  252. YLSB
  253. This command allows the user to preset the internally maintained absolute
  254. mouse position.
  255. 9.10 SET Y=0 AT BOTTOM
  256. 0x0F
  257. This command makes the origin of the Y axis to be at the bottom of the
  258. logical coordinate system internal to the ikbd for all relative or absolute
  259. mouse motion. This causes mouse motion toward the user to be negative in sign
  260. and away from the user to be positive.
  261. 9.11 SET Y=0 AT TOP
  262. 0x10
  263. Makes the origin of the Y axis to be at the top of the logical coordinate
  264. system within the ikbd for all relative or absolute mouse motion. (DEFAULT)
  265. This causes mouse motion toward the user to be positive in sign and away from
  266. the user to be negative.
  267. 9.12 RESUME
  268. 0x11
  269. Resume sending data to the host. Since any command received by the ikbd after
  270. its output has been paused also causes an implicit RESUME this command can be
  271. thought of as a NO OPERATION command. If this command is received by the ikbd
  272. and it is not PAUSED, it is simply ignored.
  273. 9.13 DISABLE MOUSE
  274. 0x12
  275. All mouse event reporting is disabled (and scanning may be internally
  276. disabled). Any valid mouse mode command resumes mouse motion monitoring. (The
  277. valid mouse mode commands are SET RELATIVE MOUSE POSITION REPORTING, SET
  278. ABSOLUTE MOUSE POSITIONING, and SET MOUSE KEYCODE MODE. )
  279. N.B. If the mouse buttons have been commanded to act like keyboard keys, this
  280. command DOES affect their actions.
  281. 9.14 PAUSE OUTPUT
  282. 0x13
  283. Stop sending data to the host until another valid command is received. Key
  284. matrix activity is still monitored and scan codes or ASCII characters enqueued
  285. (up to the maximum supported by the microcontroller) to be sent when the host
  286. allows the output to be resumed. If in the JOYSTICK EVENT REPORTING mode,
  287. joystick events are also queued.
  288. Mouse motion should be accumulated while the output is paused. If the ikbd is
  289. in RELATIVE MOUSE POSITIONING REPORTING mode, motion is accumulated beyond the
  290. normal threshold limits to produce the minimum number of packets necessary for
  291. transmission when output is resumed. Pressing or releasing either mouse button
  292. causes any accumulated motion to be immediately queued as packets, if the
  293. mouse is in RELATIVE MOUSE POSITION REPORTING mode.
  294. Because of the limitations of the microcontroller memory this command should
  295. be used sparingly, and the output should not be shut of for more than <tbd>
  296. milliseconds at a time.
  297. The output is stopped only at the end of the current 'even'. If the PAUSE
  298. OUTPUT command is received in the middle of a multiple byte report, the packet
  299. will still be transmitted to conclusion and then the PAUSE will take effect.
  300. When the ikbd is in either the JOYSTICK MONITORING mode or the FIRE BUTTON
  301. MONITORING mode, the PAUSE OUTPUT command also temporarily stops the
  302. monitoring process (i.e. the samples are not enqueued for transmission).
  303. 0.15 SET JOYSTICK EVENT REPORTING
  304. 0x14
  305. Enter JOYSTICK EVENT REPORTING mode (DEFAULT). Each opening or closure of a
  306. joystick switch or trigger causes a joystick event record to be generated.
  307. 9.16 SET JOYSTICK INTERROGATION MODE
  308. 0x15
  309. Disables JOYSTICK EVENT REPORTING. Host must send individual JOYSTICK
  310. INTERROGATE commands to sense joystick state.
  311. 9.17 JOYSTICK INTERROGATE
  312. 0x16
  313. Return a record indicating the current state of the joysticks. This command
  314. is valid in either the JOYSTICK EVENT REPORTING mode or the JOYSTICK
  315. INTERROGATION MODE.
  316. 9.18 SET JOYSTICK MONITORING
  317. 0x17
  318. rate ; time between samples in hundredths of a second
  319. Returns: (in packets of two as long as in mode)
  320. %000000xy ; where y is JOYSTICK1 Fire button
  321. ; and x is JOYSTICK0 Fire button
  322. %nnnnmmmm ; where m is JOYSTICK1 state
  323. ; and n is JOYSTICK0 state
  324. Sets the ikbd to do nothing but monitor the serial command lne, maintain the
  325. time-of-day clock, and monitor the joystick. The rate sets the interval
  326. between joystick samples.
  327. N.B. The user should not set the rate higher than the serial communications
  328. channel will allow the 2 bytes packets to be transmitted.
  329. 9.19 SET FIRE BUTTON MONITORING
  330. 0x18
  331. Returns: (as long as in mode)
  332. %bbbbbbbb ; state of the JOYSTICK1 fire button packed
  333. ; 8 bits per byte, the first sample if the MSB
  334. Set the ikbd to do nothing but monitor the serial command line, maintain the
  335. time-of-day clock, and monitor the fire button on Joystick 1. The fire button
  336. is scanned at a rate that causes 8 samples to be made in the time it takes for
  337. the previous byte to be sent to the host (i.e. scan rate = 8/10 * baud rate).
  338. The sample interval should be as constant as possible.
  339. 9.20 SET JOYSTICK KEYCODE MODE
  340. 0x19
  341. RX ; length of time (in tenths of seconds) until
  342. ; horizontal velocity breakpoint is reached
  343. RY ; length of time (in tenths of seconds) until
  344. ; vertical velocity breakpoint is reached
  345. TX ; length (in tenths of seconds) of joystick closure
  346. ; until horizontal cursor key is generated before RX
  347. ; has elapsed
  348. TY ; length (in tenths of seconds) of joystick closure
  349. ; until vertical cursor key is generated before RY
  350. ; has elapsed
  351. VX ; length (in tenths of seconds) of joystick closure
  352. ; until horizontal cursor keystokes are generated
  353. ; after RX has elapsed
  354. VY ; length (in tenths of seconds) of joystick closure
  355. ; until vertical cursor keystokes are generated
  356. ; after RY has elapsed
  357. In this mode, joystick 0 is scanned in a way that simulates cursor keystrokes.
  358. On initial closure, a keystroke pair (make/break) is generated. Then up to Rn
  359. tenths of seconds later, keystroke pairs are generated every Tn tenths of
  360. seconds. After the Rn breakpoint is reached, keystroke pairs are generated
  361. every Vn tenths of seconds. This provides a velocity (auto-repeat) breakpoint
  362. feature.
  363. Note that by setting RX and/or Ry to zero, the velocity feature can be
  364. disabled. The values of TX and TY then become meaningless, and the generation
  365. of cursor 'keystrokes' is set by VX and VY.
  366. 9.21 DISABLE JOYSTICKS
  367. 0x1A
  368. Disable the generation of any joystick events (and scanning may be internally
  369. disabled). Any valid joystick mode command resumes joystick monitoring. (The
  370. joystick mode commands are SET JOYSTICK EVENT REPORTING, SET JOYSTICK
  371. INTERROGATION MODE, SET JOYSTICK MONITORING, SET FIRE BUTTON MONITORING, and
  372. SET JOYSTICK KEYCODE MODE.)
  373. 9.22 TIME-OF-DAY CLOCK SET
  374. 0x1B
  375. YY ; year (2 least significant digits)
  376. MM ; month
  377. DD ; day
  378. hh ; hour
  379. mm ; minute
  380. ss ; second
  381. All time-of-day data should be sent to the ikbd in packed BCD format.
  382. Any digit that is not a valid BCD digit should be treated as a 'don't care'
  383. and not alter that particular field of the date or time. This permits setting
  384. only some subfields of the time-of-day clock.
  385. 9.23 INTERROGATE TIME-OF-DAT CLOCK
  386. 0x1C
  387. Returns:
  388. 0xFC ; time-of-day event header
  389. YY ; year (2 least significant digits)
  390. MM ; month
  391. DD ; day
  392. hh ; hour
  393. mm ; minute
  394. ss ; second
  395. All time-of-day is sent in packed BCD format.
  396. 9.24 MEMORY LOAD
  397. 0x20
  398. ADRMSB ; address in controller
  399. ADRLSB ; memory to be loaded
  400. NUM ; number of bytes (0-128)
  401. { data }
  402. This command permits the host to load arbitrary values into the ikbd
  403. controller memory. The time between data bytes must be less than 20ms.
  404. 9.25 MEMORY READ
  405. 0x21
  406. ADRMSB ; address in controller
  407. ADRLSB ; memory to be read
  408. Returns:
  409. 0xF6 ; status header
  410. 0x20 ; memory access
  411. { data } ; 6 data bytes starting at ADR
  412. This command permits the host to read from the ikbd controller memory.
  413. 9.26 CONTROLLER EXECUTE
  414. 0x22
  415. ADRMSB ; address of subroutine in
  416. ADRLSB ; controller memory to be called
  417. This command allows the host to command the execution of a subroutine in the
  418. ikbd controller memory.
  419. 9.27 STATUS INQUIRIES
  420. Status commands are formed by inclusively ORing 0x80 with the
  421. relevant SET command.
  422. Example:
  423. 0x88 (or 0x89 or 0x8A) ; request mouse mode
  424. Returns:
  425. 0xF6 ; status response header
  426. mode ; 0x08 is RELATIVE
  427. ; 0x09 is ABSOLUTE
  428. ; 0x0A is KEYCODE
  429. param1 ; 0 is RELATIVE
  430. ; XMSB maximum if ABSOLUTE
  431. ; DELTA X is KEYCODE
  432. param2 ; 0 is RELATIVE
  433. ; YMSB maximum if ABSOLUTE
  434. ; DELTA Y is KEYCODE
  435. param3 ; 0 if RELATIVE
  436. ; or KEYCODE
  437. ; YMSB is ABSOLUTE
  438. param4 ; 0 if RELATIVE
  439. ; or KEYCODE
  440. ; YLSB is ABSOLUTE
  441. 0 ; pad
  442. 0
  443. The STATUS INQUIRY commands request the ikbd to return either the current mode
  444. or the parameters associated with a given command. All status reports are
  445. padded to form 8 byte long return packets. The responses to the status
  446. requests are designed so that the host may store them away (after stripping
  447. off the status report header byte) and later send them back as commands to
  448. ikbd to restore its state. The 0 pad bytes will be treated as NOPs by the
  449. ikbd.
  450. Valid STATUS INQUIRY commands are:
  451. 0x87 mouse button action
  452. 0x88 mouse mode
  453. 0x89
  454. 0x8A
  455. 0x8B mnouse threshold
  456. 0x8C mouse scale
  457. 0x8F mouse vertical coordinates
  458. 0x90 ( returns 0x0F Y=0 at bottom
  459. 0x10 Y=0 at top )
  460. 0x92 mouse enable/disable
  461. ( returns 0x00 enabled)
  462. 0x12 disabled )
  463. 0x94 joystick mode
  464. 0x95
  465. 0x96
  466. 0x9A joystick enable/disable
  467. ( returns 0x00 enabled
  468. 0x1A disabled )
  469. It is the (host) programmer's responsibility to have only one unanswered
  470. inquiry in process at a time.
  471. STATUS INQUIRY commands are not valid if the ikbd is in JOYSTICK MONITORING
  472. mode or FIRE BUTTON MONITORING mode.
  473. 10. SCAN CODES
  474. The key scan codes returned by the ikbd are chosen to simplify the
  475. implementation of GSX.
  476. GSX Standard Keyboard Mapping.
  477. Hex Keytop
  478. 01 Esc
  479. 02 1
  480. 03 2
  481. 04 3
  482. 05 4
  483. 06 5
  484. 07 6
  485. 08 7
  486. 09 8
  487. 0A 9
  488. 0B 0
  489. 0C -
  490. 0D ==
  491. 0E BS
  492. 0F TAB
  493. 10 Q
  494. 11 W
  495. 12 E
  496. 13 R
  497. 14 T
  498. 15 Y
  499. 16 U
  500. 17 I
  501. 18 O
  502. 19 P
  503. 1A [
  504. 1B ]
  505. 1C RET
  506. 1D CTRL
  507. 1E A
  508. 1F S
  509. 20 D
  510. 21 F
  511. 22 G
  512. 23 H
  513. 24 J
  514. 25 K
  515. 26 L
  516. 27 ;
  517. 28 '
  518. 29 `
  519. 2A (LEFT) SHIFT
  520. 2B \
  521. 2C Z
  522. 2D X
  523. 2E C
  524. 2F V
  525. 30 B
  526. 31 N
  527. 32 M
  528. 33 ,
  529. 34 .
  530. 35 /
  531. 36 (RIGHT) SHIFT
  532. 37 { NOT USED }
  533. 38 ALT
  534. 39 SPACE BAR
  535. 3A CAPS LOCK
  536. 3B F1
  537. 3C F2
  538. 3D F3
  539. 3E F4
  540. 3F F5
  541. 40 F6
  542. 41 F7
  543. 42 F8
  544. 43 F9
  545. 44 F10
  546. 45 { NOT USED }
  547. 46 { NOT USED }
  548. 47 HOME
  549. 48 UP ARROW
  550. 49 { NOT USED }
  551. 4A KEYPAD -
  552. 4B LEFT ARROW
  553. 4C { NOT USED }
  554. 4D RIGHT ARROW
  555. 4E KEYPAD +
  556. 4F { NOT USED }
  557. 50 DOWN ARROW
  558. 51 { NOT USED }
  559. 52 INSERT
  560. 53 DEL
  561. 54 { NOT USED }
  562. 5F { NOT USED }
  563. 60 ISO KEY
  564. 61 UNDO
  565. 62 HELP
  566. 63 KEYPAD (
  567. 64 KEYPAD /
  568. 65 KEYPAD *
  569. 66 KEYPAD *
  570. 67 KEYPAD 7
  571. 68 KEYPAD 8
  572. 69 KEYPAD 9
  573. 6A KEYPAD 4
  574. 6B KEYPAD 5
  575. 6C KEYPAD 6
  576. 6D KEYPAD 1
  577. 6E KEYPAD 2
  578. 6F KEYPAD 3
  579. 70 KEYPAD 0
  580. 71 KEYPAD .
  581. 72 KEYPAD ENTER