home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / UTILITY / KEYBOARD / STUFF310.ZIP / STUFFIT.DOC < prev   
Encoding:
Text File  |  1991-04-29  |  15.9 KB  |  459 lines

  1.  
  2.  
  3. StuffIt.Doc             Last updated by Roedy Green 1991 April 12
  4.  
  5.  
  6. PURPOSE
  7.  
  8. Stuffit is a utility that automates the keyboard.  You can
  9. provide a script of keystrokes and Stuffit will automatically
  10. type them into your application programs.  What makes Stuffit
  11. different from other keyboard macro programs:
  12.  
  13.   1. The keyboard remains fully functional the entire time
  14.      for additional manual input or correction.
  15.  
  16.   2. Stuffit works with intractable programs that throw away
  17.      keystrokes, bypass DOS etc.
  18.  
  19.   3. Stuffit watches the screen.  It does not just type
  20.      blindly.
  21.  
  22.   4. Stuffit watches the clock.  It can wake up your computer
  23.      at any time of the day and run programs.
  24.  
  25.   4. Stuffit can handle large scripts, up to 64K.
  26.  
  27.   5. Stuffit lets you generate more possible keystroke
  28.      chords (combinations) than other products.
  29.  
  30.   7. Assembler source code is provided, giving you the
  31.      option of adding new features to the program.
  32.  
  33.  
  34. COMMAND LINE PARAMETERS IN A NUTSHELL
  35.  
  36. +0                  Delay until the application has used up all
  37.                     the keystrokes in the type-ahead buffer.
  38.                     This is useful for applications that throw
  39.                     away keystrokes fed to it too quickly.
  40.                     This is also a handy way to flush any pending
  41.                     (uneaten) codes from a previous invocation of
  42.                     StuffIt. e.g.:
  43.                     StuffIt +0
  44.                     empties StuffIt's internal buffer.
  45.  
  46. +hh:mm:ss           time delay. (hours and minutes optional)
  47.                     +4   means wait 4 seconds (must be 0..59).
  48.                     +2:4 means wait 2 minutes and 4 seconds.
  49.                     +5:: means wait 5 hours.
  50.  
  51. =hh:mm:ss           delay until a specific time of day (24 hour
  52.                     format)
  53.                     (hours and minutes optional).
  54.                     =16:00:00 means wait till 4 PM.
  55.                     =00:00:00 means wait till midnight.
  56.                     =0   also means wait till midnight.
  57.  
  58. nn                  stuff a given character code
  59.                     e.g. 27 for Escape, 13 for Enter
  60.                     Only ASCII decimal numerics are accepted.
  61.                     There are no mnemonics for control
  62.                     characters.
  63.                     See ASCII code chart in your IBM AT tech
  64.                     Reference.
  65.  
  66. @nn                 stuff an extended code preceded by a null.
  67.                     Only numerics are accepted.  There are
  68.                     presently no mnemonics for these characters:
  69.                     e.g.  @68 = F10, @73 = PgUp etc.
  70.                     See table following for common codes.
  71.  
  72. cc:ss               specify both the decimal character and its
  73.                     scan code
  74.                     e.g. 43:74 to mean the Plus key on the
  75.                     numeric keypad, rather than the ordinary plus
  76.                     key. See table following for common pairs.
  77.  
  78. 'xxxx'              Stuff the characters between the quote marks.
  79.                     The string itself may not contain 's.
  80.  
  81. "xxxx"              Stuff the characters between the double quote
  82.                     marks.  The string itself may not contain "s.
  83.  
  84. F70,20,5,01,"Please enter your phone number"
  85.                     The absolute FIND command.
  86.                     Wait patiently for text to appear at col,
  87.                     row, length, attribute.  The attribute is
  88.                     optional.
  89.                     StuffIt searches starting at column 70, row
  90.                     20 for the string "Please enter your phone
  91.                     number".
  92.                     It waits until the string appears.  The 5
  93.                     means allow some slop.  The string may START
  94.                     anywhere in a window 5 characters wide.  It
  95.                     does not mean the whole string must FIT in a
  96.                     window five characters wide.  See note below
  97.                     on Stuffit's co-ordinate system.  The 01 is a
  98.                     rarely used feature.  It means, the match
  99.                     only counts if the string is displayed with
  100.                     decimal video attribute "01".
  101.  
  102. P10,1,160,01,"Please enter your phone number"
  103.                     The relative PROMPT command.
  104.                     Wait patiently for text to appear at relative
  105.                     col, row, length, attribute.  The attribute
  106.                     is optional.  Stuffit searches for the string
  107.                     "Please enter your phone number" starting
  108.                     left ten columns, and up one row from where
  109.                     the cursor is.  It waits until the string
  110.                     appears.  The 160 means allow some slop.  The
  111.                     string may START anywhere in a window 160
  112.                     characters wide (two lines).  It does not
  113.                     mean the whole string must FIT in the window.
  114.                     The 01 is a rarely used feature.  It means,
  115.                     the match only counts if the string is
  116.                     displayed with decimal video attribute "01".
  117.  
  118. !                   Reboot. (=0 ! will reboot at midnight.)
  119.  
  120. /F:MyFile.Txt       Read commands from MyFile.Txt instead for
  121.                     from the command line.  This command may be
  122.                     only be used on the command line, not nested
  123.                     in a file.
  124.  
  125. /B:512              Allocate room for 512 bytes for the script.
  126.                     You must allocate enough to store the ENTIRE
  127.                     script once it has been converted to a
  128.                     compact internal form.  On initial loading,
  129.                     StuffIt will use a minimum of 512 bytes, or
  130.                     automatically expand to whatever is necessary
  131.                     to needed to store the compact tokenized form
  132.                     of the input file.  If you want to save a few
  133.                     bytes you can prune it back using the /B:
  134.                     command.  Future versions may do this
  135.                     automatically.
  136.  
  137. /R                  will Remove (Unload) Stuffit from RAM.
  138.                     StuffIt is a TSR and so stays resident in
  139.                     RAM.  The overhead is minuscule, a mere 1232
  140.                     bytes, half of which is the buffer.
  141.  
  142.  
  143. CO-ORDINATE SYSTEM
  144.  
  145. The co-ordinate system Stuffit uses for the FIND command is very
  146. familiar to programmers who poke bytes into the video REGEN buffer 
  147. of display adapters, but it may seem a little strange to someone who
  148. has a mathematical background.  Mathematicians have two systems:
  149.  
  150.   1. X,Y co-ordinates where the origin 0,0 is in the lower
  151.      left corner.
  152.  
  153.   2. Matrices indexed by row and column.  Usually rows and
  154.      columns are numbered starting with 1.  Rows are
  155.      numbered starting at the top.  Traditionally co-
  156.      ordinates are given in the order row, then column.
  157.  
  158. Stuffit uses a hybrid of these two schemes.  It uses row and
  159. column, but starts numbering at 0,0 instead of 1,1 in the upper
  160. left corner.  Stuffit uses column, row order.
  161.  
  162. For relative positioning in the PROMPT command, left and up are
  163. considered positive.  This is the exact opposite convention to
  164. what the FIND command uses.  Beware!
  165.  
  166.  
  167. EXAMPLES:
  168.  
  169. Format floppies alternately in A: and B:, without answering any
  170. prompts:
  171.  
  172. REM EXAMPLE 1 FLOPPY FORMATTER
  173. echo off
  174. :loop
  175. Stuffit ' ' +0 13 P25,0,5,"Format another" +1 'N' 13
  176. format A:
  177. Stuffit ' ' +0 13 P25,0,5,"Format another" +1 'N' 13
  178. format B:
  179. goto loop
  180.  
  181.  
  182. Use one PC for both backup and Host GW on a LAN:
  183.  
  184. REM EXAMPLE 2 AUTOEXEC.BAT
  185. Rem Start backup program in batch mode:
  186. Rem Use Stuffit, to reboot GW program at midnight
  187. Stuffit =00:00:00 !
  188. Rem Start GW program
  189. LAN-GW
  190.  
  191.  
  192.  
  193. TROUBLE SHOOTING
  194.  
  195. PROBLEM: Stuffit fails to send all the keystrokes.  Only some
  196. keystrokes get through.
  197.  
  198. SOLUTION: Your application is clearing the type-ahead buffer from
  199. time to time.  You can outfox it by using the +2 command to
  200. insert a short delay AFTER the program has cleared the type-ahead
  201. buffer before Stuffit starts poking characters into it again.
  202. This can be combined with the F and P commands to hold off
  203. generating the keystrokes until a omen appears on the screen that
  204. the program is ready for input and is not about to throw away the
  205. keystrokes you feed it.  Sometimes you must combine the
  206. techniques, an F or P command followed by a short delay.
  207.  
  208. PROBLEM: Stuffit just echoes its command syntax summary no matter
  209. what I do.
  210.  
  211. SOLUTION:
  212. Stuffit is laconic in its error messages.  It does not tell you
  213. what you did wrong.  You have to guess.  The way you do this is
  214. to take out all your commands.  Then add them one by one.  The
  215. one you last added at the time of failure is the one with the
  216. syntax error.
  217.  
  218. Note that Stuffit completely analyzes the script before starting
  219. to send any keystrokes to your application.  If there is even one
  220. tiny error in it, it will not do anything.
  221.  
  222. PROBLEM:  My program insists I use keypad - minus.  Where do I
  223. find the magic colon pair for such keystrokes?
  224.  
  225. SOLUTION:  There is a list of the most commonly used pairs at the
  226. end of this document.  See the IBM AT Technical reference manual
  227. for more information on system scan codes.
  228.  
  229. PROBLEM: You referred me to the IBM AT Technical Reference Manual
  230. for scan codes and ASCII codes.  I don't have this expensive
  231. book.  What can I do?
  232.  
  233. SOLUTION: Call Falk Data Systems at (915) 684-7670, 5322 Rockwood
  234. Court, El Paso Texas, 79932.  They make an inexpensive wall chart
  235. that shows the ASCII codes.
  236.  
  237. PROBLEM: I want to generate Shift-PrtSc.  There does not appear
  238. to be a scan code for this combination.
  239.  
  240. SOLUTION: BIOS processes Shift-PrtSc and Ctrl-Alt-Del directly.
  241. It does not put them in the keystroke buffer.  Perhaps a future
  242. version of Stuffit will simulate Shift-PrtSc.  (The ! command
  243. does simulate Ctrl-Alt-Del to reboot the computer.)
  244.  
  245. PROBLEM: the F command does not work to fetch a script out of a
  246. file.
  247.  
  248. SOLUTION: The command is /F:, not F, for fetching from a file.
  249. This is confusing.  The F command is for FINDING a magic string
  250. on the screen.  Perhaps you forgot the colon or inserted spaces.
  251.  
  252. PROBLEM: My program does not seem to recognize the keystrokes.
  253.  
  254. SOLUTION:  It is unlikely, but one possible cause is this:  when
  255. you DON'T use the colon form to give Stuffit both the ASCII and
  256. scan code, then Stuffit fakes it by using 2 as the scan code.
  257. Most programs do not check the scan code, but a few might be
  258. confused.  Stuffit generates the proper scan code only for a few
  259. keys -- BS, Tab, Esc, Enter.  If your application needs a
  260. specific scan code/char combination, you must use the CC:SS form.
  261.  
  262.  
  263. HOW DOES IT WORK
  264.  
  265. Most typists can type faster than programs can process
  266. keystrokes.  Thus the BIOS stores keystrokes in a type-ahead
  267. buffer.  Stuffit works by sneakily poking keystrokes to the type-
  268. ahead buffer when BIOS is not looking.  Stuffit thus has no need
  269. of taking over INT 16 to control the handing over of keystrokes
  270. to the application.  The advantage of this method is, Stuffit
  271. works with programs that sneak past INT 16 to use the Enhanced
  272. 101-key keyboard features.
  273.  
  274. There are 254 different extended ASCII codes that can be stored
  275. in a byte.  However there are control sequences such as F1, Home,
  276. Ctrl-F1 which don't have a 1-byte code.  These require a two byte
  277. code, the first byte being a 0-byte lead in.  Stuffit can easily
  278. handle poking that pair into the keystroke buffer, using the @nn
  279. feature.
  280.  
  281. There are some keys duplicated on the keyboard.  For example
  282. there is a + key sharing the = key.  There also a + key on the
  283. numeric keypad.  Most programs do not care which + key you
  284. pressed. Some do.  These programs find out by using interrupt HEX
  285. 16 function 00.  The processed character is returned in AL and
  286. the semi-cooked scan code from the keyboard is returned in AH.
  287. If you the program is picky, you can get Stuffit to generate the
  288. precise character and scan code using the cc:ss command.
  289.  
  290. Because of history, with each new keyboard design attempting to
  291. maintain partial compatibility with earlier designs, the process
  292. of generating a keystroke has become more and more complex.  Each
  293. keypress down generates a code, as does each key release.  The
  294. keyboard itself translates the codes from row-column on the
  295. keyboard to a raw scan code format.  Then the keyboard controller
  296. in the PC (a miniature computer in its own right) translates them
  297. again.  Then the BIOS translates them yet again, and matches up
  298. the ups and downs, notices chords (multiple keys pressed at once
  299. such as Ctrl Alt and Shift) and generates the keystrokes and puts
  300. them in the keystroke type-ahead buffer.  Further DOS, with its
  301. KEYB utility, may interfere with BIOS to support foreign
  302. keyboards.  So you can see the term "scan" code has many meanings
  303. -- depending just where in this assembly line you look at the
  304. codes.
  305.  
  306.  
  307. SCAN CODES
  308.  
  309. Here are the Stuffit codes for some keystrokes you might want to
  310. generate.  See your IBM AT Tech manual for more:
  311.  
  312. 43:13       plus + on the equal key
  313. 43:78       plus + on the keypad
  314.  
  315. 45:12       minus - on the on the underscore key
  316. 45:74       minus - on the keypad
  317.  
  318. 174         <<
  319. 175         >>
  320. 65          A -(normally use "A" instead)
  321. 07          Bel
  322. @83         Del
  323. @80         Down-Arrow
  324. 224:72 @80 Down-Arrow on the arrow pad
  325. 130         e acute
  326. @79         End
  327. 13          Enter
  328. 13:224      Enter on the keypad
  329. 27          Esc
  330. @71         Home
  331. @82         Ins
  332. @74         Left-Arrow
  333. 224:72 @74  Left-Arrow on the arrow pad
  334. @3          nul
  335. @81         PgDn
  336. @73         PgUp
  337. @77         Right-Arrow
  338. 224:72 @77  Right-Arrow on the arrow pad
  339. 09          Tab
  340. @72         Up-Arrow
  341. 224:722 @72 Up-Arrow on the arrow pad
  342.  
  343. @59         F1
  344. @60         F2
  345. @61         F3
  346. @62         F4
  347. @63         F5
  348. @64         F6
  349. @65         F7
  350. @66         F8
  351. @67         F9
  352. @68         F10
  353. @87         F11
  354. @88         F12
  355.  
  356. @120        Alt 1
  357. @121        Alt 2
  358. @122        Alt 3
  359.  
  360.  
  361. @123        Alt 4
  362. @124        Alt 5
  363. @125        Alt 6
  364. @126        Alt 7
  365. @127        Alt 8
  366. @128        Alt 9
  367.  
  368. @104        Alt F1
  369. @105        Alt F2
  370. @106        Alt F3
  371. @107        Alt F4
  372. @108        Alt F5
  373. @109        Alt F6
  374. @110        Alt F7
  375. @111        Alt F8
  376. @112        Alt F9
  377. @113        Alt F10
  378.  
  379. @30         Alt-A
  380. @48         Alt-B
  381. @46         Alt-C
  382. @32         Alt-D
  383. @18         Alt-E
  384. @33         Alt-F
  385. @34         Alt-G
  386. @35         Alt-H
  387. @23         Alt-I
  388. @36         Alt-J
  389. @37         Alt-K
  390. @38         Alt-L
  391. @50         Alt-M
  392. @49         Alt-N
  393. @24         Alt-O
  394. @25         Alt-P
  395. @16         Alt-Q
  396. @19         Alt-R
  397. @31         Alt-S
  398. @20         Alt-T
  399. @22         Alt-U
  400. @47         Alt-V
  401. @17         Alt-W
  402. @45         Alt-X
  403. @21         Alt-Y
  404. @44         Alt-Z
  405.  
  406. @94         Ctrl-F1
  407. @95         Ctrl-F2
  408. @96         Ctrl-F3
  409. @97         Ctrl-F4
  410. @98         Ctrl-F5
  411. @99         Ctrl-F6
  412. @100        Ctrl-F7
  413. @101        Ctrl-F8
  414. @102        Ctrl-F9
  415. @103        Ctrl-F10
  416.  
  417. !           Ctrl-Alt-Del
  418. @117        Ctrl-End
  419. @119        Ctrl-Home
  420. 12          Ctrl-L
  421. @115        Ctrl-Left-Arrow
  422. @118        Ctrl-PgDn
  423. @132        Ctrl-PgUp
  424. @114        Ctrl-PrtSc
  425.  
  426.  
  427. @116        Ctrl-Right-Arrow
  428.  
  429. @84         Shift-F1
  430. @85         Shift-F2
  431. @86         Shift-F3
  432. @87         Shift-F4
  433. @88         Shift-F5
  434. @89         Shift-F6
  435. @90         Shift-F7
  436. @91         Shift-F8
  437. @92         Shift-F9
  438. @93         Shift-F10
  439.             Shift-PrtSc -- there IS no code for this.
  440.  
  441. CREDITS
  442.  
  443. Terje W. Mathisen wrote Stuffit and the first documentation.
  444. Roedy Green polished the documentation.
  445.  
  446.  
  447. PAYMENT AND LICENSING
  448.  
  449. This program is absolutely FREE.  I don't want money, I have
  450. money.  What I want is recognition (admiration?), from other
  451. programmers.  You may use it for whatever you like, but it is not
  452. warranted for any purpose.  Copyright 1991 by Terje W. Mathisen.
  453.  
  454. Terje W. Mathisen
  455. Oslo, January 1991.
  456.  
  457.  
  458.  
  459.