(int key)
| 1142 | }; |
| 1143 | |
| 1144 | private static String Keys_MenuKey_f(int key) { |
| 1145 | menuaction_s item = (menuaction_s) Menu_ItemAtCursor(s_keys_menu); |
| 1146 | |
| 1147 | if (bind_grab) { |
| 1148 | if (key != K_ESCAPE && key != '`') { |
| 1149 | //char cmd[1024]; |
| 1150 | String cmd; |
| 1151 | |
| 1152 | //Com_sprintf(cmd, sizeof(cmd), "bind \"%s\" \"%s\"\n", |
| 1153 | // Key_KeynumToString(key), bindnames[item.localdata[0]][0]); |
| 1154 | cmd = "bind \"" + Key.KeynumToString(key) + "\" \"" |
| 1155 | + bindnames[item.localdata[0]][0] + "\""; |
| 1156 | Cbuf.InsertText(cmd); |
| 1157 | } |
| 1158 | |
| 1159 | Menu_SetStatusBar(s_keys_menu, |
| 1160 | "enter to change, backspace to clear"); |
| 1161 | bind_grab = false; |
| 1162 | return menu_out_sound; |
| 1163 | } |
| 1164 | |
| 1165 | switch (key) { |
| 1166 | case K_KP_ENTER: |
| 1167 | case K_ENTER: |
| 1168 | KeyBindingFunc(item); |
| 1169 | return menu_in_sound; |
| 1170 | case K_BACKSPACE: // delete bindings |
| 1171 | case K_DEL: // delete bindings |
| 1172 | case K_KP_DEL: |
| 1173 | UnbindCommand(bindnames[item.localdata[0]][0]); |
| 1174 | return menu_out_sound; |
| 1175 | default: |
| 1176 | return Default_MenuKey(s_keys_menu, key); |
| 1177 | } |
| 1178 | } |
| 1179 | |
| 1180 | private static void Menu_Keys_f() { |
| 1181 | Keys_MenuInit(); |
no test coverage detected