The "processKey" function below is made to recognize what key you have pressed on the keyboard and perform some action based on which key was pressed. All of the keys that are programmed below work. I need to add in to the function the ability to detect the four arrow keys (up, down, left, right) as well as CTRL UP and CTRL DWN. I understand that there is no Ascii code for these keys and that there are scan codes. Could some body please help me find the scan codes? I have tried looking online but haven't had much luck. If it has anything to do with the operating system I am running Windows 8.1 on my Macintosh. Thank you!
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