| 1072 | } |
| 1073 | |
| 1074 | Boolean |
| 1075 | topl_key(unsigned char ch, Boolean ext) |
| 1076 | { |
| 1077 | switch (ch) { |
| 1078 | case CHAR_ESC: |
| 1079 | topl_replace("\x1b"); |
| 1080 | case CHAR_ENTER: |
| 1081 | case CHAR_CR: |
| 1082 | case CHAR_LF: |
| 1083 | return false; |
| 1084 | |
| 1085 | case 0x1f & 'P': |
| 1086 | mac_doprev_message(); |
| 1087 | return true; |
| 1088 | case '\x1e' /* up arrow */: |
| 1089 | topl_replace(""); |
| 1090 | return true; |
| 1091 | case CHAR_BS: |
| 1092 | case '\x1c' /* left arrow */: |
| 1093 | if ((*top_line)->selEnd <= topl_query_len) |
| 1094 | return true; |
| 1095 | else if (ext) { |
| 1096 | topl_replace(""); |
| 1097 | return true; |
| 1098 | } |
| 1099 | default: |
| 1100 | TEKey(ch, top_line); |
| 1101 | if (ext) { |
| 1102 | int com_index = -1, oindex = 0; |
| 1103 | while (extcmdlist[oindex].ef_txt != (char *) 0) { |
| 1104 | if (!strncmpi(*(*top_line)->hText + topl_query_len, |
| 1105 | extcmdlist[oindex].ef_txt, |
| 1106 | (*top_line)->teLength - topl_query_len)) { |
| 1107 | if (com_index == -1) /* No matches yet*/ |
| 1108 | com_index = oindex; |
| 1109 | else /* More than 1 match */ { |
| 1110 | com_index = -2; |
| 1111 | break; |
| 1112 | } |
| 1113 | } |
| 1114 | oindex++; |
| 1115 | } |
| 1116 | if (com_index >= 0) |
| 1117 | topl_replace((char *) extcmdlist[com_index].ef_txt); |
| 1118 | } |
| 1119 | return true; |
| 1120 | } |
| 1121 | } |
| 1122 | |
| 1123 | static void |
| 1124 | topl_flash_resp(int resp_idx) |
no test coverage detected