MCPcopy Index your code
hub / github.com/BombusMod/BombusMod / getKeyCode

Method getKeyCode

src/main/java/ui/keys/UserKey.java:158–171  ·  view source on GitHub ↗
(String name)

Source from the content-addressed store, hash-verified

156 }
157
158 private static int getKeyCode(String name) {
159 for (int i = 0; i < COUNT_KEY_NAMES; i++)
160 if (name.equals(someNames[i]))
161 return someCodes[i];
162
163 if (name.length() == 1) {
164 char ch = name.charAt(0);
165 if (((ch > 64) && (ch < 91)) // [A-Z]
166 || ((ch > 96) && (ch < 123))) // [a-z]
167 return (int) ch;
168 }
169
170 return Integer.parseInt(name);
171 }
172
173 private static boolean withModificator(String name) {
174 if ((name.length() > 1) && (name.charAt(0) == 'M'))

Callers 1

createFromStringsMethod · 0.95

Calls 1

equalsMethod · 0.45

Tested by

no test coverage detected