home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / r / rapidkeys / !RapidKeys / !Help next >
Encoding:
Text File  |  1994-11-13  |  22.2 KB  |  587 lines

  1.  
  2.                             Function Key Handler
  3.                             ====================
  4.  
  5.           (c) Copyright Peter Tuson 1992
  6.  
  7. This product is distributed as public domain. It be reproduced in
  8. whole or part by any means without written permission of the author.
  9.  
  10. While every care is taken, the author cannot be held responsible for
  11. any errors in this product, or for the loss of any data or
  12. consequential effects from the use of this package.
  13.  
  14. RISC OS, ARCHIMEDES, DRAW and EDIT are trademarks of Acorn Computers
  15. Limited.
  16.  
  17. OVATION is a trademark of BEEBUG Limited.
  18.  
  19. PIPEDREAM is a trademark of Colton Software.
  20.  
  21. All enquiries should be addressed to:
  22.  
  23.     Dr. P.R.Tuson
  24.     70, Connaught Road
  25.     Fleet
  26.     Hants.
  27.     GU13 9QY
  28.     United Kingdom.
  29.  
  30. Release 1.3.4 June 1994 by Dr.P.R.Tuson.
  31. Compatible with RISC OS 3.1 and above.
  32.  
  33. 1.0 Introduction
  34.  
  35. !RapidKeys is a function key handler for the Acorn Archimedes series
  36. of computers.
  37.  
  38. The purpose of !RapidKeys is to provide a simple but powerful
  39. interface to the 12 function keys and the Print, Copy, Insert and
  40. Delete keys, allowing them to be defined, displayed on the monitor
  41. screen and activated, using the mouse, within the RISC OS environment.
  42.  
  43. !RapidKeys is designed to avoid the need for the function key strip
  44. associated with the early series of Archimedes computers.
  45.  
  46. The keys may be programmed to send key sequences to the current focus
  47. window thus allowing function keys for most applications to be
  48. remapped to the user's requirements and extra functions keys to be
  49. added to the application.
  50.  
  51. By using !RapidKeys the user may access the full set of function keys
  52. by using one hand to operate the keyboard while the other is operating
  53. the mouse.
  54.  
  55. 1.1 Using !RapidKeys
  56.  
  57. The function key handler may be installed on the iconbar by double
  58. clicking on the !RapidKeys application icon.
  59.  
  60. The functions defined within the resource file StdKeyDefs are then
  61. loaded, together with the configuration file. The function keys are
  62. then active.
  63.  
  64. Selection of the !RapidKeys icon on the iconbar toggles the display of
  65. the function key mnemonics. !RapidKeys may be configured to display
  66. the mnemonics immediately on loading.
  67.  
  68. The function key mnemonics may be displayed horizontally just above
  69. the iconbar or vertically on the left or right hand side of the
  70. screen. On loading, the default position of the displayed mnemonics is
  71. read from the configuration file.
  72.  
  73. The !RapidKeys application is controlled by the RapidKeys menu
  74. accessed by pressing the menu button while the mouse pointer is over
  75. the !RapidKeys iconbar icon.
  76.  
  77. The functions of the menu options are as follows:
  78.  
  79.   Info provides current information about the application.
  80.  
  81.   Define opens a dialogue window allowing the operation of any of the
  82.   function keys; F1 to F11, Shift F1 to Shift F11, Ctrl F1 to Ctrl F11
  83.   and Ctrl Shift F1 to Ctrl Shift F11 and the additional keys; Print,
  84.   Insert, Delete and Copy to be defined.
  85.  
  86.   Display controls the display of the mnemonics. When displayed any
  87.   function key can be operated by selection of the key mnemonic. A
  88.   tick indicates the state of the displayed mnemonics.
  89.  
  90.   Command opens a dialogue window allowing the entry of * commands, not
  91.   defined by any of the function keys, from the keyboard.
  92.  
  93.   Configure opens a dialogue box allowing the operation of !RapidKeys
  94.   to be tailored to the user's requirements.
  95.  
  96.   Save allows all the loaded key definitions to be saved to a file
  97.   using the standard 'Save as' convention used by RISC OS 
  98.   applications.
  99.  
  100.   Quit removes the !RapidKeys application from the Task memory.
  101.  
  102. Double clicking on a Key Definition file causes the new definitions to
  103. be loaded, the !RapidKeys application will be loaded if not already
  104. resident and RISC OS has 'seen' the !RapidKeys application directory.
  105.  
  106. Multiple Key Definition files may be loaded.  The !RapidKeys
  107. application will expand its memory requirement, as necessary, to load
  108. additional Key Definition files.
  109.  
  110. The key definitions and the displayed mnemonics are linked to the task
  111. controlling the current input focus window. Key definitions may be
  112. loaded for all active tasks such that as the input focus is moved
  113. between windows the displayed mnemonics change to reflect the
  114. definitions for the new task.
  115.  
  116. Key definitions may also be linked to a dialogue box controlled by a
  117. task. Again the displayed mnemonics are changed to reflect the new
  118. definitions when the input focus is moved to the dialogue box.
  119. Unfortunately clicking a mouse button outside a dialogue box
  120. normally causes the dialogue box to disappear so the displayed
  121. mnemonic keys cannot be used to send function key events to a dialogue
  122. box.
  123.  
  124. If no window has the input focus or the task controlling the input
  125. focus window has no key definitions defined or the dialogue box with
  126. the input focus has no key definitions defined then the default key
  127. definitions will be active.
  128.  
  129. A set of common key definitions may be defined that are common between
  130. all tasks. These may be used to identify the functions of the F12 key
  131. which is reserved for use by RISC OS.
  132.  
  133. !RapidKeys automatically chooses the optimum size of the displayed key
  134. mnemonics according to the screen mode. The size is updated if the
  135. screen mode is changed for any reason.
  136.  
  137. 2.0 Installation
  138.  
  139. The !RapidKeys application is supplied on a single disc, the contents
  140. of which are as follows:
  141.  
  142.    !Boot         RapidKeys !Boot file.
  143.    !Run          RapidKeys !Run file.
  144.    !RunImage     RapidKeys runtime code.
  145.    !Help         Help text file.
  146.    !Sprites      Directory of sprite files for the RapidKeys
  147.                  application.
  148.    Templates     Window and dialogue box templates.
  149.    Resources
  150.      Config      Startup state for !RapidKeys.
  151.      Common      Key definitions used for all tasks.
  152.      Default     Default key definitions.
  153.      Draw        Example key definitions for !Draw.
  154.      Edit        Example key definitions for !Edit.
  155.      Ovation     Example key definitions for !Ovation.
  156.      Pipedream4  Example key definitions for !Pipedream 4.
  157.      Pendown+    Example key definitions for !Pendown+.
  158.      Squirrel    Example key definitions for !Squirrel.
  159.      SrcEdit     Example key definitions for !SrcEdit.
  160.      StdKeyDef   Default Key definitions called up by !Run file.
  161.  
  162. It is recommended that the !RapidKeys disc is copied either to a hard
  163. drive or to another floppy disc and the original stored in a safe
  164. place.
  165.  
  166. To copy this application open a directory viewer on the destination
  167. disc within the RISC OS Desktop and drag the !RapidKeys icon to the
  168. destination directory in the normal manner.
  169.  
  170. Load !RapidKeys by double clicking on the application icon.
  171.  
  172. 2.1 Memory Requirements
  173.  
  174.     Program Area 128K
  175.  
  176. 2.2 Other Requirements
  177.  
  178.     RISC OS 3.01 or later.
  179.     CLIB Version 3.99 or later.
  180.  
  181. 3.0 Detailed Operation
  182.  
  183. On selection of a displayed function key mnemonic with the mouse
  184. button !RapidKeys processes the definition associated with the
  185. function key.
  186.  
  187. If the definition is null then a key press event is sent to the Task
  188. Manager for onward transmission to the application controlling the
  189. current input focus window.
  190.  
  191. The Shift and Control keys can be used to modify the action of the
  192. function keys.  The pressing of one or both of these keys results in a
  193. change to the displayed mnemonics.
  194.  
  195. If a function key is pressed on the keyboard the event is sent, by the
  196. Task Manager, directly to the application controlling the input focus
  197. window. Correctly behaved applications will then pass unrecognised key
  198. presses on for later processing by 'Hot Key' applications. In this
  199. event !RapidKeys will process the definition associated with the
  200. function key, if the definition is null then the key press will be
  201. passed on.
  202.  
  203. In summary the displayed function key will always be operated on
  204. selection whereas the keyboard function key will only be operated if
  205. the application controlling the current input focus window passes the
  206. key press on for 'Hot Key' applications.
  207.  
  208. F12 may be given a mnemonic but definition of this key is disabled to
  209. allow RISC-OS full access.
  210.  
  211. The Define Key dialogue box, accessed by selection of the 'define'
  212. iconbar menu option, allows definition of the keys corresponding to
  213. the task controlling the input focus window. If no window has the
  214. input focus then the default set of key definitions may be entered.
  215.  
  216. The save iconbar option will save all of the key definitions
  217. previously loaded, in alphabetical order, to the indicated file.
  218.  
  219. 3.1 Configuration
  220.  
  221. The operation of the !RapidKeys application can be modified by the use
  222. of the Choices menu option.
  223.  
  224. Currently this allows control of position, visibility and startup.
  225.  
  226. When the required configuration has been selected then the Set button
  227. will set the configuration for the current invocation. This may result
  228. in a change to the displayed mnemonics.
  229.  
  230. The Save button will both set the current configuration and save the
  231. configuration within the Resource directory.
  232.  
  233. 3.1.1 Position
  234.  
  235. The mnemonic function keys may be displayed horizontally, just above
  236. the iconbar, or vertically, on the left or right hand side of the
  237. screen. This corresponds to the 'Bottom', 'Left' and 'Right' options
  238. within the Position box in the lower portion of the dialogue box.
  239.  
  240. 3.1.2 Visibility
  241.  
  242. The visibility is controlled by the buttons within the Cover box and
  243. allows the function key mnemonics and iconbar to remain visible when
  244. windows are grown to full screen.
  245.  
  246. Visibility control is enabled when the on/off button is depressed.
  247.  
  248. One of 'Raise Focus Window' or 'Lower Key Mnemonics' may be activated.
  249.  
  250. The 'Raise Focus Window' control may be used in whatever position the
  251. function key mnemonics are currently displayed but the action depends
  252. on the position.
  253.  
  254. If the mnemonics are displayed horizontally, above the iconbar, then
  255. the !RapidKeys application will move the bottom boundary of any window
  256. opened to the full screen extent to just above the position of the
  257. mnemonics.
  258.  
  259. If the mnemonics are displayed vertically, on the left or right, then
  260. the !RapidKeys application will move the bottom boundary of any window,
  261. opened to the full screen extent, to just above the iconbar and the
  262. left or right boundary of the window to the right or left of the
  263. mnemonics.
  264.  
  265. The 'Lower Key Mnemonics' control is only applicable when the
  266. mnemonics are displayed horizontally, above the iconbar. In this case
  267. the function key mnemonics are then moved to the bottom of the screen
  268. and the bottom boundary of the window to just above the position of
  269. the mnemonics. When the window is returned to a smaller size the
  270. function key mnemonics are returned to their normal position above the
  271. iconbar.
  272.  
  273. Note that visibility control will not effect fully open windows that
  274. do not cover the full screen size, or any other window, that may be
  275. positioned over the function key mnemonics.
  276.  
  277. 3.1.3 Startup
  278.  
  279. The startup control is activated when the 'Startup' button on the
  280. right hand side of the configuration box is depressed.
  281.  
  282. Startup control causes the function key mnemonics to be displayed
  283. immediately on initiation of the !RapidKeys application.
  284.  
  285. 3.1.4 Popup
  286.  
  287. The popup control is activated when the 'Popup' button on the
  288. right hand side of the configuration box is depressed.
  289.  
  290. When Popup is enabled the entry of a keyboard character causes a
  291. command entry dialogue box to be opened on the screen to allow
  292. entry and operation of a command string.
  293.  
  294. 3.2 3-D Interface
  295.  
  296. The function key mnemonics appear on 3 dimensional buttons that
  297. depress when the mouse select button is clicked, similar to the
  298. !Impression interface and now supported by RISC OS 3.
  299.  
  300. This 3 dimensional look and feel is carried across to all windows
  301. controlled by !RapidKeys.
  302.  
  303. 3.3 Defining Key Functions
  304.  
  305. The mnemonic and action of function keys may be defined using the
  306. define dialogue box.
  307.  
  308. The dialogue box is used to define the mnemonic and action of function
  309. keys for the task controlling the window with the input focus. If no
  310. window has the input focus then the dialogue box is used to define
  311. function keys for the 'Default' task.
  312.  
  313. The right and left arrow icons can be used to sequence through the
  314. function keys.
  315.  
  316. Alternatively, and more conveniently, any function key can be
  317. identified by pressing the corresponding keyboard function key (in
  318. conjunction with the shift and control keys as necessary).  The
  319. dialogue box will then show the current definition for that function
  320. key.
  321.  
  322. While the function key is identified in the dialogue box it can be
  323. given a definition or redefined.
  324.  
  325.     Enter the mnemonic for the function key in the name field, this
  326.     accepts a string of up to fourteen characters.
  327.  
  328.     Enter the action for the function key in the function field, this
  329.     accepts a string of up to 255 characters.
  330.  
  331. Both the name and function fields provide full editing features for
  332. the entered string, as follows:
  333.  
  334.   Delete      delete character to the left of caret.
  335.   Copy        delete character to the left of caret.
  336.   <-          move caret left one character.
  337.   ->          move caret right one character.
  338.   Shift Copy  delete word (forwards).
  339.   Shift <-    move left one word.
  340.   Shift ->    move right one word.
  341.   Ctrl Copy   delete to end of line (forwards).
  342.   Ctrl <-     move to left end of line.
  343.   Ctrl ->     move to right end of line.
  344.  
  345. Definition of a function key can be aborted by selecting the CANCEL
  346. icon.
  347.  
  348. The definition of the identified function key is actioned by selecting
  349. the Define icon or pressing the <CR> key at the end of the function field.
  350.  
  351. The function key definition is then loaded, the displayed mnemonics
  352. may change.
  353.  
  354. If the Define icon is actioned with the ADJUST button then the define
  355. dialogue box will remain displayed so that additional function keys
  356. may be defined. 
  357.  
  358. 3.4 Mnemonic Format
  359.  
  360. In order to take advantage of the increased number of characters
  361. available within the displayed mnemonic on higher definition screen
  362. modes the '_' and '.' characters can be used to delimit optional
  363. sections of the mnemonic text.
  364.  
  365. The minimum width available to a mnemonic in any mode is 5 characters.
  366.  
  367. This is best explained by use of a example.
  368.  
  369. F3S is commonly used to insert a file at the cursor position.  The
  370. mnemonic for this can be defined as 'Ins_e.rt_File'.
  371.  
  372. As a minimum the _e. and _File will both be ignored at the displayed
  373. mnemonic will be 'Insrt', i.e. no more than 5 characters.
  374.  
  375. In a higher definition mode 9 characters may be available, in this
  376. case the first optional text will be accepted and the displayed
  377. mnemonic will be 'Insert'.
  378.  
  379. Finally in screen modes where 10 or more characters are available the
  380. displayed mnemonic will be 'InsertFile'.
  381.  
  382. The actual mnemonic, most suitable for the current screen mode, is
  383. found by scanning the definition and inserting optional text from left
  384. to right until additional insertion would result in an oversized
  385. mnemonic.
  386.  
  387. Optional text is identified by an '_' character at the start and a '.'
  388. or ' ' character at the end, the '.' character must be used if there
  389. is following text.
  390.  
  391. 3.5 Command Format
  392.  
  393. Commands use the standard command line syntax of RISC OS and may be
  394. followed by one or more parameters.
  395.  
  396. The defined action of a function key may consist of one or more
  397. commands separated by the ';' character.
  398.  
  399. !RapidKeys processes the commands Echo, Eval and Menu internally, all
  400. other commands are passed to RISC OS for action.
  401.  
  402.   Echo causes the following character string to be translated using
  403.   OS_GSTrans and then output to the task controlling the window with
  404.   the input focus.  This is equivalent to the *Echo command.
  405.  
  406.   Eval causes the following character string to be translated using
  407.   OS_EvaluateExpression and then output to the task controlling the
  408.   window with the input focus.  This is equivalent to the *Eval
  409.   command.
  410.  
  411.   Menu causes the following character string to be transmitted to the
  412.   task controlling the input focus window as a 'Menu Selection' event.
  413.   This is equivalent to selected a pop up menu option within the input
  414.   focus window. In this case the character string consists of a
  415.   sequence of comma separated numbers, the first number identifies the
  416.   selected item in the main menu (starting from 0), the second the
  417.   selected item in the first submenu and so on. Thus the full path to
  418.   the required item can be specified.
  419.  
  420. After translating the Echo and Eval commands the RapidKeys application
  421. interprets some characters internally.
  422.  
  423.   & following by 3 hexadecimal characters is encoded into a single
  424.     character before being output to the controlling task.
  425.  
  426.   @ stores the index position of the cursor in the input focus   
  427.     window assuming that the system font is being used.
  428.  
  429.   % outputs the previously stored index position as a string of
  430.     characters to the controlling task.
  431.  
  432. The characters &, @ and % can be output to the contolling task by
  433. preceding with &, e.g. &@ will output @.
  434.  
  435. The delimiter character ';' can be output by enclosing the character
  436. string in quotes, e.g "abd;de".
  437.  
  438. In order to pass the commands *Echo and *Eval to the operating system
  439. use the lower case form, i.e. echo and eval.
  440.  
  441. 3.5.1 Example
  442.  
  443. As an example consider the 'C' KeyDefs file provided, this contains
  444. the lines.
  445.  
  446.     task Edit
  447.     key F1SC   ©               Echo Copyright Dr.P.R.Tuson <Sys$Year>
  448.     key F2SC   Date            Echo <Sys$Date> <Sys$Year>
  449.     key F3SC   Time            Echo <Sys$Time>
  450.     key F4SC   Year            Echo <Sys$Year>
  451.     key F5SC   if              Echo "&196@if()
  452.                                     {|M&186}|M&186&1A4&1AC&1AB%|M&196"
  453.     key F6SC   for             Echo "&196@for (;;)
  454.                                     {|M&186}|M&186&1A4&1AC&1AB%|M&196"
  455.     key F7SC   while           Echo "&196@while ()
  456.                                     {|M&186}|M&186&1A4&1AC&1AB%|M&196"
  457.     key F8SC   proc            Echo static void procname ()|M{|M}|M
  458.  
  459. The first line indicates that these key definitions are intended for
  460. windows controlled by the !Edit application.  This name must be
  461. identical to the task name used by the application, this can be
  462. identified using the Task display window from the Task Manager. If the
  463. task name contains embedded spaces then these should be replaced by
  464. the non-blank space with HEX code A0, this can be typed using the key
  465. sequence 160 with the Alt key pressed down.
  466.  
  467. The remaining lines program the function keys Ctrl Shift F1 to Ctrl
  468. Shift F8.  When this file is loaded into the !RapidKeys application
  469. these definitions will be added to any definitions for the !Edit
  470. application already defined. If one or more of the function keys have
  471. already been defined then the new definition will replace the older.
  472.  
  473. The function key Ctrl Shift F1 is programmed with the string:
  474.  
  475.    Echo Copyright Dr.P.R.Tuson <Sys$Year>
  476.  
  477. The '<>' characters cause Sys$Year to be looked up as a system
  478. variable, so that if this function key is activated the string
  479.  
  480.    Copyright Dr.P.R.Tuson 1994
  481.  
  482. may be output to the input focus window.
  483.  
  484. The function key Ctrl Shift F6 is programmed with the string:
  485.  
  486.   Echo "&196@for (;;) {|M&186}|M&186&1A4&1AC&1AB%|M&196"
  487.  
  488. This is intended to output the sequence
  489.  
  490.    for (;;) {
  491.    }
  492.  
  493. to the input focus window at the current cursor position.
  494.  
  495. The echoed string is quoted because it includes the delimiter
  496. character ';', &196 corresponds to Shift F6 which clears any currently
  497. defined block then @ causes the current cursor index position to be
  498. saved.  Next the first line of the string is output - for (;;) {|M. 
  499. The start of a block is then marked with the code &186, corresponding
  500. to F6, and the second line is output - }|M.  The end of the block is
  501. then defined with the code &186.
  502.  
  503. The code &1A4 corresponds to Ctrl F4 and causes !Edit to open the
  504. Insert Window, this becomes the input focus window.  The codes &1AC
  505. &1AB clear the Insert Window of its contents and % inputs the string
  506. for the original cursor index position.  The return code |M actions
  507. the insert and the marked block is indented to the original cursor
  508. position.
  509.  
  510. The final code &196 clears the marked block.
  511.  
  512. 3.6 Command Entry
  513.  
  514. Commands may be entered directly, without recourse to the command
  515. line, by using the command entry dialogue box.
  516.  
  517. If no window has the input focus, i.e. contains the caret, then the
  518. command entry dialogue box will be displayed on entry of the first
  519. character of the required command.  Otherwise the dialogue box can be
  520. opened using the command option in the RapidKeys icon menu.
  521.  
  522. The dialogue box will accept a command string of up to 255 characters.
  523.  
  524. Multiple commands can be entered in the command string, separated by
  525. the ';' character.
  526.  
  527. The dialogue box provides full editing features for the entered
  528. string, as follows:
  529.  
  530.   Delete      delete character to the left of caret.
  531.   Copy        delete character to the left of caret.
  532.   <-          move caret left one character.
  533.   ->          move caret right one character.
  534.   Shift Copy  delete word (forwards).
  535.   Shift <-    move left one word.
  536.   Shift ->    move right one word.
  537.   Ctrl Copy   delete to end of line (forwards).
  538.   Ctrl <-     move to left end of line.
  539.   Ctrl ->     move to right end of line.
  540.  
  541. The entered command can be aborted by selecting the CANCEL icon.
  542.  
  543. The command is actioned by selecting the OK icon or pressing the <CR>
  544. key. Any output text not destined for the input focus window is
  545. displayed within a mode 4 window.  If the OK icon is actioned with the
  546. ADJUST button then the command dialogue box will remain displayed.
  547.  
  548. 4.0 File Types
  549.  
  550. !RapidKeys recognised standard ASCII text files of type FFF.
  551.  
  552. 5.0 Limitations
  553.  
  554. Operation with RISC OS 2 has not been checked.
  555.  
  556. 6.0 Modifications
  557. V1.2.0 March 1991
  558.   Copied from !Keys to generate full multi-tasking version by identifying
  559.   window with icon focus and relating back to controlling task.
  560. V1.2.1 January 1992
  561.   Various bug fixes. 
  562. V1.2.2 July 1992
  563.   Use of Interface module to provide a 3-Dimensional display.
  564.   Use of higher definition screen modes has been improved by automatic
  565.   scaling of the key mnemonics and by allowing optional sections within
  566.   mnemonic text.
  567.   The Save function now conforms to the RISC OS operation by supplying
  568.   the previous saved filename, on startup this is the StdKeyDefs file.
  569.   A Configuration menu has been added.
  570.   The key mnemonics may be automatically displayed on startup.
  571.   KeyDef files have been moved to the Resources directory.
  572. V1.2.3 December 1992
  573.   Updated to conform to RISC OS 3.1.
  574. V1.3
  575.   Allowed key mnemonics to be on either side or bottom of sceen.
  576.   Added support for Print, Insert, Delete and Copy keys.
  577. V1.3.1
  578.   Introduced Common Task and support for Desktop Boot Files.
  579.   Addition of the Menu command.
  580. V1.3.2
  581.   Changed KeyDefs file type to TEXT.
  582.   Conform to Style Guide.
  583.   Some bug fixes.
  584. V1.3.3
  585.   More bug fixes.
  586. V1.3.4
  587.   Suppress definition of F12.