MCPcopy Create free account
hub / github.com/demoth/jake2 / Keys_MenuKey_f

Method Keys_MenuKey_f

client/src/main/java/jake2/client/Menu.java:1144–1178  ·  view source on GitHub ↗
(int key)

Source from the content-addressed store, hash-verified

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();

Callers 1

executeMethod · 0.95

Calls 7

Menu_ItemAtCursorMethod · 0.95
KeynumToStringMethod · 0.95
InsertTextMethod · 0.95
Menu_SetStatusBarMethod · 0.95
KeyBindingFuncMethod · 0.95
UnbindCommandMethod · 0.95
Default_MenuKeyMethod · 0.95

Tested by

no test coverage detected