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