Moderator note: program surrounded by 'code' tags for compactness.
Yes, but it is a bit involved: use GETKEY to catch the menu keys.
A few things to know:
- you want GETKEY to catch only the keys you want, and do nothing on others. The simplest way is putting all key codes in ALPHA and using POSA to check for them, but I use a matrix instead (see below), as you may need the ALPHA register for AGRAPHs.
- GETKEY doesn't catch the EXIT key, which I have always found a shame; so you'll need to designate another key to exit.
- GETKEY doesn't catch the DM42 top row softkeys UNLESS a menu is present. That can be accomplished in program mode by EDITing a matrix.
The following program lets you add "A" or "B" to the screen when pressing softkey 1 or 2, repeatedly. Use key 6 to Exit. No menu labels are shown.
(this is the ONLY way I have found to interact with a graphics display; it is what I used in the matrix Viewer. Using MENU and pressing a key clears the LCD, and redrawing the whole DM42 screen takes too long for comfort.)
Code: Select all
00 { 106-Byte Prgm }
01▸LBL "AB"
02 CLLCD
03 3 @ set up the matrix of valid GETKEY codes
04 1
05 NEWMAT
06 EDIT
07 1
08 →
09 2
10 →
11 6
12 EXITALL
13 LSTO "GK"
14 EDIT @ EDIT a matrix so the top row keys work
15 1
16 ENTER
17 "÷" @ dummy AGRAPH to show the graphics screen on first GETKEY
18 AGRAPH
19▸LBL 09 @ main loop
20 CLA
21 SF 25
22▸LBL 10 @ GETKEY loop
23 GETKEY
24 RCL- "GK"
25 1/X @ causes an error when key valid, so CF 25 and LastX still contains keycode
26 R↓
27 FS? 25
28 GTO 10
29 GTO IND ST L
30▸LBL 01 @ add "A"
31 126
32 XTOA
33 9
34 XTOA
35 XTOA
36 XTOA
37 R↓
38 XTOA
39 GTO 00
40▸LBL 02 @ add "B"
41 127
42 XTOA
43 ├"III6"
44▸LBL 00
45 R↓
46 AGRAPH
47 6
48 +
49 GTO 09
50▸LBL 06 @ exit
51 EXITALL
52 CLD @ quit graphics screen
53 END
Cheers, Werner