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
|
-
|
|
|
-
|
|
|
|
!
| #ifndef __STICK_EX__
#define global __STICK_EX__
#undef stick
#module mdl_stick
#define global set_stick_keys( %1, %2 ) key_code@mdl_stick( %1 ) = %2 : len_keys@mdl_stick = length( key_code@mdl_stick )
#deffunc init_stick
dim key_code, 11
set_stick_keys 0, 37 set_stick_keys 1, 38 set_stick_keys 2, 39 set_stick_keys 3, 40 set_stick_keys 4, 32 set_stick_keys 5, 13 set_stick_keys 6, 17 set_stick_keys 7, 27 set_stick_keys 8, 1 set_stick_keys 9, 2 set_stick_keys 10, 9 return
#deffunc _stick@mdl_stick var result, int no_trigger, int check_mode, int half_trigger
result = 0
repeat len_keys
getkey tmp, key_code( cnt )
result |= tmp << cnt
loop
if ( check_mode == 1 ) & ( ginfo_act == -1 ){
prev = result
result = 0
} else {
tmp = result
result &= ( -1 ^ prev ) | no_trigger
prev = tmp
}
return
#define global stick( %1, %2=0, %3=1, %4=0 ) _stick@mdl_stick %1, %2, %3, %4
#global
init_stick
#if 0
set_stick_keys 4, 'Z' mes "Zキーを押してみてください。16が返ります。\n逆にスペースキーでは何の値も返りません。"
*main
stick keys, %11111 title str( keys )
wait 2
goto *main
#endif #endif
|