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

Method StringToKeynum

client/src/main/java/jake2/client/Key.java:471–485  ·  view source on GitHub ↗

Returns a key number to be used to index keybindings[] by looking at the given string. Single ascii characters return themselves, while the K_ names are matched up.

(String str)

Source from the content-addressed store, hash-verified

469 * the K_* names are matched up.
470 */
471 private static int StringToKeynum(String str) {
472
473 if (str == null)
474 return -1;
475
476 if (str.length() == 1)
477 return str.charAt(0);
478
479 for (int i = 0; i < keynames.length; i++) {
480 if (str.equalsIgnoreCase(keynames[i]))
481 return i;
482 }
483
484 return -1;
485 }
486
487 private static void Message(int key) {
488

Callers 2

Key_Bind_fMethod · 0.95
Key_Unbind_fMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected