www.jupiter-ace.co.uk
 
News, Reviews and Letters Index > Codifying the Ace Cursor (Letter).
Personal Computer News June 16, 1983 'Microwaves' page 16

Codifying the
Ace cursor
Many Ace users will want to use the cursor and editing keys in their own programs. The Ace manual does not list the relevant codes for use with INKEY: All are accessed using the caps shift:
Key
Function
Code
1
Delete line
10
2
Caps lock
2
3
None
51
4
Inverse video
8
5
Cursor left
1
6
Cursor up
7
7
Cursor down
9
8
Cursor right
3
9
Graphics
4
0
Delete
5
The short routine demonstrates the use of these codes by moving an asterisk around using the arrow keys.
Ralph Lorenz,
Henley-in-Arden, Warwickshire
0 VARIABLE X 0 VARIABLE Y
: POINT X @ Y @ AI 42 EMIT ;
: VERT INKEY   7   =   IF X @ 1- X ! THEN
INKEY   9   =   IF X @ 1+ X ! THEN ;
: HORIZ INKEY 1   =   IF Y @ 1- Y ! THEN
INKEY 3   =   IF Y @ 1+ Y ! THEN ;
: TEST BEGIN 1000 0 DO LOOP X @ Y @
AT SPACE VERT HORIZ POINT
0 UNTIL ;
(enter TEST to run the demonstration)