OSDN Git Service

20021009版ソース
[seraphyscrtools/SeraphyScriptTools.git] / TestScript / key.vbs
1 option explicit
2
3 class mainwnd
4 private wnd
5 private px,py,code,excode
6 private sub class_initialize
7         px = 50
8         py = 50
9         set wnd = obj.mainframe
10         with wnd
11                 .open("KEYDOWN EVENT")
12                 .SetTimer 30
13                 .ClassObject = me
14                 .DoModal
15         end with
16 end sub
17
18 public sub OnKeydown
19         code = wnd.event.parameter
20         excode = wnd.event.extparameter
21         select case code
22         case 104 py = py - 10
23         case  98 py = py + 10
24         case 100 px = px - 10
25         case 102 px = px + 10
26         end select
27 end sub
28
29 public sub OnTimer
30         with wnd.canvas.layer(0)
31                 .clear
32                 .setmappingmode 1
33                 .text 0,0,code & ":" & excode
34                 .circle px,py,10
35         end with
36         wnd.draw
37 end sub
38
39 end class
40
41 dim obj,app
42 set obj = createobject("seraphyscripttools.instance")
43
44 set app = new mainwnd