Prev: 26908 Up: Map Next: 27013
26921: Keyboard processing loop
Used by the routines at START_TURN, ACTION_QUIT and ACTION_END.
KEYBOARD_HANDLER 26921 LD HL,27200 HL=prompt symbol
26924 CALL PRINT_TO_SCREEN_2 Display prompt symbol
26927 LD (IY+7),0 Cursor = C,K or L
26931 SET 3,(IY+1) Set keyboard mode to 'L'
26935 SET 3,(IY+48) Set CAPS lock on
26939 BIT 0,(IY+8) Should we dump flags?
26943 CALL NZ,DUMP_FLAGS If so, call dump flag routine
26946 CALL OPEN_SCREEN_CHANNEL Open screen channel
26949 LD HL,25000 HL=user keypress buffer
26952 LD D,L D=start of keypress buffer
26953 LD A,L A=start of keypress buffer
26954 ADD A,30 A=end of keypress buffer
26956 LD E,A E=end of keypress buffer
26957 RES 5,(IY+1) Reset 'key pressed' flag
This entry point is used by the routine at DELETE_PRESSED.
KEYBOARD_HANDLER_0 26961 CALL WAIT_FOR_KEY Wait for keypress
26964 CP 12 Is it delete?
26966 JR Z,DELETE_PRESSED If so, handle delete
26968 LD B,A B=key pressed
26969 LD A,D
26970 CP L Are we still at start of buffer?
26971 LD A,B A=key pressed
26972 JR Z,KEYBOARD_HANDLER_1 If at start of buffer, skip newline check
26974 CP 13 Is it newline?
26976 JR Z,ENTER_PRESSED If so handle newline
KEYBOARD_HANDLER_1 26978 LD A,E A=end of buffer
26979 CP L Are we at end of buffer?
26980 LD A,B
26981 JR Z,KEYBOARD_HANDLER_0 If at end of buffer, don't process more characters
26983 CP 32 Has space been pressed?
26985 JR Z,KEYBOARD_HANDLER_2 If so, process this keypress
26987 CALL 11547 Has a number key been pressed?
26990 JR NC,KEYBOARD_HANDLER_2 If so, process this keypress
26992 CP 91 Is key pressed > 91 'Z'?
26994 JR NC,KEYBOARD_HANDLER_0 If so, ignore it
26996 CP 65 Is key pressed < 65 'A'?
26998 JR C,KEYBOARD_HANDLER_0 If so, ignore it
KEYBOARD_HANDLER_2 27000 CALL STORE_CHAR_ENTERED Store character in buffer
27003 PUSH HL
27004 LD HL,27193 HL points to flashing cursor control characters
This entry point is used by the routine at DELETE_PRESSED.
KEYBOARD_HANDLER_3 27007 CALL PRINT_TO_SCREEN_2 Display flashing cursor
27010 POP HL
27011 JR KEYBOARD_HANDLER_0 Get another character
Prev: 26908 Up: Map Next: 27013