下面的“processKey”功能用于识别您在键盘上按下的键,并根据按下的键执行一些操作。下面编程的所有键都可以工作。我需要在函数中添加检测四个箭头键(上、下、左、右)以及 CTRL UP 和 CTRL DWN 的功能。我知道这些键没有 Ascii 代码,并且有扫描代码。有人可以帮我找到扫描码吗?我曾尝试在网上查找,但运气不佳。如果它与我在 Macintosh 上运行 Windows 8.1 的操作系统有关。谢谢!
processKey PROC
PUSH AX BX
MOV AH, 10h
INT 16h
CMP AL, 1Bh ;ESC key?
JE ESCKey
JMP F1Key
ESCKey:
MOV AH, 4Ch
INT 21h
F1Key:
CMP AX, 3B00h ;F1 key?
JE toggleLineType
JMP F2Key
toggleLineType:
CMP singleOrDouble, 0
JE toggleDouble
MOV singleOrDouble, 0
JMP done
toggleDouble:
MOV singleOrDouble, 1
JMP done
F2Key:
CMP AX, 3C00h ;F2 key?
JE foregroundToggle
JMP F3Key
foregroundToggle:
CMP foreground, 7
JE resetForeground
MOV BL, foreground
INC BL
MOV foreground, BL
JMP done
resetForeground:
MOV foreground, 1
F3Key:
CMP AX, 3D00h ;F3 key?
JE backgroundToggle
JMP done
backgroundToggle:
CMP background, 7
JE resetBackground
MOV BL, background
INC BL
MOV background, BL
JMP done
resetBackground:
MOV background, 1
done:
POP BX AX
CALL drawBox
RET
processKey ENDP