1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
-
|
-
|
!
| #module
#deffunc bcls int, int
mref c, 0 mref wt, 1 ginfo 1
mref bm, 96+prmx
redraw 1 if wt<1 : wt = 10
await wt
redraw 0
ginfo_r = bm.40&(1<<8-1)
ginfo_g = bm.40&(1<<16-1)>>8
ginfo_b = bm.40&(1<<24-1)>>16
clr = 4-c * 64 -1 color clr, clr, clr : boxf : color ginfo_r, ginfo_g, ginfo_b
pos 0, 0
return
#global
#module
#deffunc getkeyini
dim gkey, 121
dim gkeyold, 121
dim gkeyuse, 121
return
#deffunc getkey2 val, int
mref key, 16
mref code, 1
getkey gkey.code, code
if (gkey.code ! gkeyold.code)&(gkey.code = 1) {
key = 1 } else {
key = 0 }
gkeyold.code = gkey.code
return
#global
getkeyini
#if 0
dim key, 128
color 255,0,0
*main
bcls 0, 100
getkey2 key.0, 65 if key.0 = 1 : mes "a キーが押されました。"
goto *main
#endif
|