-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathview_handler.asm
45 lines (39 loc) · 969 Bytes
/
view_handler.asm
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
.486
.model flat, stdcall
option casemap:none
include view_handler.inc
include ui.inc
include control.inc
.code
;复用了编辑部分的代码
UpKeyHandler PROTO
LeftKeyHandler PROTO
RightKeyHandler PROTO
DownKeyHandler PROTO
ViewKeyHandler PROC, input:KEY_INPUT
.IF input.is_special == TRUE
.IF input.virtual_key == VK_LEFT
invoke LeftKeyHandler
.ELSEIF input.virtual_key == VK_RIGHT
invoke RightKeyHandler
.ELSEIF input.virtual_key == VK_UP
invoke UpKeyHandler
.ELSEIF input.virtual_key == VK_DOWN
invoke DownKeyHandler
.ELSEIF input.virtual_key == VK_BACK
invoke LeftKeyHandler
.ENDIF
.ELSE
.IF input.ascii_char == 'h'
invoke LeftKeyHandler
.ELSEIF input.ascii_char == 'l'
invoke RightKeyHandler
.ELSEIF input.ascii_char == 'j'
invoke DownKeyHandler
.ELSEIF input.ascii_char == 'k'
invoke UpKeyHandler
.ENDIF
.ENDIF
ret
ViewKeyHandler ENDP
END