KEY$
reserved variable: define a keyboard macro
Key$(number)=command$
command$=Key$(number)
KEY$ assigns the contents of the specified command$ to a function key number from 1 to 20. Keys 1 to 10 are accessed by pressing the appropriate function key at the same time as the [left Amiga] key. Similarly, numbers 11 to 20 are accessed in conjunction with the [right Amiga] key. If these keys are not pressed simultaneously, they will be misinterpreted as two separate key presses!
Single quotes can be used to enclose a comment, which will only be displayed in your key definition list and will be completely ignored by the macro routine. For example:
X> Key$(3)="'Comment' Print"
Also note that by pressing [Alt]+[Quote] together, a special return code is generated.
If you need to generate a key press that has no Ascii equivalent, such as an [up arrow], the appropriate scan-code can be included in a macro definition. This is achieved by using the SCAN$ function, explained next.
SCAN$
function: return a scan-code for use with Key$
x$=Scan$(scan-code)
x$=Scan$(scan-code,mask)
The scan-code parameter refers to the scan-code of a key that is to be used in one of your macro definitions. There is also an optional mask parameter, which sets special keys such as [Ctrl] and [Alt], and the format is the same as for KEY SHIFT, explained earlier.
Improving your typing skills
The AMOS Professional programmer is offered as much help as possible to enter listings quickly
and correctly. As many structures as possible are automatically recognised and correctly
formatted, even if upper and lower case is sometimes confused and spacings are not quite
perfect. But even the most experienced programmer can be fumble-fingered at times.
KEY SPEED
instruction: change key repeat speed.
Key Speed time-lag,delay-speed
During editing, a character or cursor movement is repeated for as long as its key is held down. This can be frustrating if it causes unwanted characters or cursor movements. KEY SPEED lets you change the repeat rate while a key is held down, to your own particular preference. State the time-lag you want to use between pressing a key and the start of the repeat sequence, measured in 50ths of a second.