home *** CD-ROM | disk | FTP | other *** search
/ 1st Multimedia Mac Shareware / Multimedia Shareware CD-ROM - BetaCorp.iso / FKeys / FunKeyƒ / FunKey Docs.c next >
Encoding:
Text File  |  1991-03-06  |  7.6 KB  |  175 lines  |  [TEXT/ttxt]

  1. /*
  2.  
  3. FunKey 1.1.1
  4.  
  5. by Alex D. Chaffee
  6.     chaffee@reed.uucp
  7.     Compuserve: 71210,1117
  8.     Reed College Box 259, Portland, OR 97202
  9.     
  10. Copyright © 1990.  All Rights Reserved.  Permission is granted to
  11. distribute freely, as long as this document and copyright information
  12. remain intact and are distributed along with the program.
  13.  
  14. Portions Copyright © 1989 Symantec Corporation.  Thanks to Michael Kahl et 
  15. al. for THINK C.
  16.  
  17. Also thanks to Paul Mercer, Darin Adler, Paul Snively, and Ken McLeod for
  18. ShowInit, Jason "We don't need no stinking patches" Klivington, and Steve
  19. Riggins and all the CompuServe/Usenet gurus for invaluable support and
  20. assistance.
  21.  
  22. Introduction:
  23.  
  24. FunKey is a replacement for Carlos Weber's old (but excellent) Pop-Keys 
  25. INIT.  Like Pop-Keys, it allows you to pull up a popup menu from which 
  26. you can select  any installed FKEYs.  Like Pop-Keys, the menu can be 
  27. selected by moving to a part of the screen.  Also, when you hold down 
  28. the familiar Command and Shift keys, FunKey changes the pointer to its 
  29. own "F" cursor.  The menu pops up when you click the mouse button.  FunKey 
  30. also overcomes some bugs and shortcomings of Pop-Keys.
  31.  
  32. Installation:
  33.  
  34.     FunKey is a standard INIT, complete with startup icon.  To install it,
  35.     simply drag it into the system folder and reboot.  If you hold down
  36.     the mouse button during startup, FunKey will not install.
  37.  
  38. Usage:
  39.  
  40.     Like the man said - hold down Command and Shift at any point after
  41.     startup, and you will see the Funky Cursor.  You can then select a
  42.     function key the normal way - by pressing a number from zero to nine -
  43.     or the Funky way - by holding down the mouse button.  A menu will
  44.     appear, containing the names and ID#s of all FKEYs in the system
  45.     folder, installed with Suitcase or the like, and in any open files.  
  46.     Selecting an FKEY from the menu will activate it, just as if you had 
  47.     pressed the associated key.  The FKEYs which are installed on the 
  48.     keyboard are denoted by command-key equivalents (although pressing 
  49.     these keys while the menu is up won't do anything).  FKEYs with no 
  50.     name are named "Untitled."
  51.     
  52.     In the "About Box" is a checkbox allowing you to select whether or
  53.     not you'd like to see the ID numbers in the menu.  Untitled FKEYs will
  54.     always show their numbers, so that you can tell them apart.  (It's
  55.     not a bug...)  The About Box also has a set of self-explanatory radio 
  56.     buttons entitled "Sort by Name" and "Sort by Number."  If you change
  57.     any of these settings, FunKey will try to remember them by creating
  58.     a file called "FunKey Prefs" in your System Folder.  Actually, it
  59.     will put it in a folder called "Preferences", creating said folder if
  60.     it's not already there.  These names are in STR resource #128, if
  61.     you'd like to change them.
  62.     
  63.     (The use of a Preferences folder to reduce system folder clutter is
  64.     supported by several other programs, and it's relatively easy to fix
  65.     some INITs to use it as well.  Look in the INIT's resource fork with
  66.     ResEdit for a STR or STR# whose contents are the name of the
  67.     preferences file.  Add ":Preferences:" to the beginning of this string.
  68.     For example, Boomerang 2.0's STR -4048 resource reads, "Boomerang
  69.     Prefs".  Change this to ":Preferences:Boomerang Prefs", move your
  70.     Boomerang Prefs file into the Preferences folder, and reboot.  If
  71.     it crashes, you can always change it back...)
  72.     
  73.     As of version 0.4, there will be a 1 second delay between the time
  74.     you press command-shift and the time the cursor shows up.  You can
  75.     still click the mouse during the lag time.
  76.  
  77.     As of version 1.1 (enough of this 0.x nonsense), you can define a 
  78.     "hot rect" in which Funkey will act as though the cmd and shift keys
  79.     are pressed. To disable the hot rect, set it to (0,0,0,0).
  80.     
  81. Known Bugs and Limitations:
  82.  
  83. •    FunKey doesn't work quite right under MultiFinder: if you click above
  84.     a window that's not in the current layer, the menu will work all
  85.     right, but before it comes up or after it goes away, MultiFinder will 
  86.     *sometimes* switch layers.  (Note that normally, the mouse clicks are 
  87.     invisible to the  current application -- but keystrokes are revceived
  88.     by the application, to accomodate the Cmd-Shift menu items of 
  89.     some applications.)
  90.     
  91.     Sometimes, immediately after switching layers in the above fashion, an
  92.     item in the menu will appear as a dotted line.  Selecting this line 
  93.     will do nothing but beep.  The complete menu will return the next time.
  94.  
  95. •    If you have a lot of FKEYs installed, it may take a second or two
  96.     for the menu to come up after you click the mouse.  As of version 0.2,
  97.     FunKey only rebuilds its internal list whenever it has to, so the
  98.     first pause should be the longest.  There may be a way to make it
  99.     faster, but it may be more trouble than it's worth... If you find that
  100.     it's unusable at its present speed, let me know and I'll be more 
  101.     motivated to fix it.
  102.  
  103. Wish List:
  104.  
  105. •    Allow for user-configurable "hot" keys (other than Command-Shift)
  106. •    FKEY mover features, like Renumber, Rename, and Open File
  107. •    "Where Is" function - to show the file a given FKEY is from
  108. •    ...Suggestions?
  109.  
  110. Technical Info:
  111.  
  112. FunKey patches the low-memory global jGNEFilter to install its own
  113. GetNextEvent filtering routine.  This routine checks GetKeys to set the
  114. cursor, then if the event is a mouseDown, pops the menu.  FunKey also 
  115. patches SetCursor and InitCursor so that the Funky Cursor isn't changed 
  116. while Command and Shift are down.  To find out when it has to rebuild its
  117. list, it first checks to see if the resource map looks different, then
  118. checks all its handles to make sure they're valid.  Thus if you load or
  119. unload a new FKEY file with Suitcase or Juggler, or switch layers into
  120. an application with its own FKEYs, then the next time you use FunKey it'll
  121. rebuild its list.
  122.  
  123. A Request:
  124.     
  125.     I am not asking for any remuneration for FunKey, other than the
  126.     following:  if you like it, if you find a bug, if you have any
  127.     suggestions or gripes, or if you want to say "Hi," please let me know.  
  128.     I'm not in this for the money (at least not yet), only for the 
  129.     satisfaction of knowing that my (enjoyable) efforts have also been
  130.     enjoyed by others.
  131.  
  132. Version History:
  133.  
  134. 10/89    Prototype written
  135. 1/8/90    After finals and break, version 0.1 is ready to roll
  136. 1/28/90    Version 0.2
  137.         •    It's now a bit quicker - it only rebuilds its internal FKEY
  138.             list when something has changed.  (The remaining delay is
  139.             for the menu itself to be built.)  When it's doing this it
  140.             shows the watch cursor.
  141.         •    It builds the list right after startup too.  This time it
  142.             shows the Funky cursor.
  143.         •    You can no longer use FunKey from within its own About Box.
  144.             (Which means you'd better not do an exit-to-shell from the
  145.             About Box -- FunKey will never turn itself back on!)
  146.         •    Now uses a slightly optimized quicksort algorithm for a few
  147.             precious ticks of speed.
  148.         •    Preferences in About Box and Funky Prefs file (see above).
  149.         •    "Funky Down" sound (courtesy of James Brown)
  150.  
  151. 2/4/90    Version 0.3
  152.         •    About Box / prefs file crash fixed
  153.         •    Removed hooks for sound (sorry, James!)
  154.         •    Cooler About Box
  155.         
  156. 5/16/90    Version 0.4
  157.         •    Compatible with Kiss INIT
  158.         •    Now creates a Preferences folder if one doesn't exist
  159.         •    Never accidentally uses someone else's menu instead
  160.         •    Sets cursor to arrow when a normal cmd-shift-key is pressed
  161.             Note: this doesn't work in DAs.
  162.         •    Added Cursor Delay (1 sec.) so screen dump FKEYs work (FKEYs 
  163.             get called by the system before FunKey gets a chance to turn 
  164.             its cursor off).  You can still click up the menu even though 
  165.             the cursor isn't showing.
  166.         •    Added some error alerts (esp. "Not enough memory to load 
  167.             FKEY.")
  168.  
  169. 3/5/91    Version 1.1
  170.         •    Hot Rect added
  171. 3/6/91    Version 1.1.1
  172.         •    Added xNIT icon
  173.         •    Made sure version is always correct
  174. */
  175.