home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 300-399 / ff344.lzh / Keyboard / RawDemo.doc < prev    next >
Text File  |  1990-04-14  |  3KB  |  57 lines

  1.  
  2. RawDemo, RawDemo.mod, Keyboard.def, and Keyboard.mod
  3. 25 March 1990
  4.  
  5. INTRODUCTION
  6.  
  7.      These listings are based on the listings in the C language that
  8. appeared on Fish Disk 291 by Fabbian G. Dufoe, III.
  9.  
  10.      They have been translated into Modula-2 by Peter Graham Evans.
  11.  
  12.      There is no point in repeating the background to the listings here.
  13. Please see the documentation on Fish Disk 291. However, there are some
  14. comments throughout the listings that enlarge upon what was said in
  15. Dufoe's programs. They mostly relate to sources I had to go to in order
  16. to translate the programs and get them up and running under Modula-2.
  17.  
  18.      When I first saw the programs I was very pleased that someone had
  19. been able to reduce a complex procedure into readable and understandable
  20. code. I have seen many programs in many languages and read a number of
  21. articles on this same subject but Dufoe's explanations were crystal clear.
  22.  
  23.      I can't understand why someone hasn't written like routines before.
  24. These routines should be standard for any language on the Amiga. (I have
  25. seen programs which go SOME of the way to what Dufoe has done.) I haven't
  26. seen any Modula-2 examples which do raw key translations. Raw keys are
  27. just too hard for the average programmer to handle! There is no two ways
  28. about this. With Keyboard.def and Keyboard.mod no Modula-2 programmer
  29. can use the "too hard" excuse anymore. (The same applies to C programmers
  30. using Dufoe's code.)
  31.  
  32.      How does the C approach and Modula-2 approach weigh up? The executable
  33. for Modula-2 comes in just over 500 bytes lighter than the original C
  34. version. I would like to see someone else bring down the size even more.
  35. The Modula-2 code has more constants in Keyboard.def (they aren't needed
  36. for raw key conversion but I threw them in), some more text in the window
  37. title, and less text in the error messages. I have tried to be true to the
  38. original C language source but had to make a few changes including some
  39. efficiences where possible. It took me just over 41 hours from start to
  40. finish. I struck a few problems like the TDI implementation of OpenDevice
  41. insisting on a cardinal as the second parameter and setting up the
  42. InputEvent correctly for the RawKeyConvert procedure.
  43.  
  44. TESTING UNDERTAKEN
  45.  
  46.     1. checked the integer codes returned were OK (including dead keys)
  47.     2. multitasks OK with itself
  48.     3. ran MemWatch throughout testing
  49.     4. changed SetMap program that comes with AmigaDOS 1.3 to German
  50.        keyboard; clicked twice on SetMap icon; tested RawDemo
  51.  
  52. DOCUMENTATION OF FUNCTIONS
  53.  
  54.     Naturally they are a part of the definition module to Keyboard.
  55.  
  56.  
  57.