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

Method keyExecute

src/main/java/ui/keys/UserKeyExec.java:198–228  ·  view source on GitHub ↗
(int key, boolean onlyWithModificator)

Source from the content-addressed store, hash-verified

196 }
197
198 public boolean keyExecute(int key, boolean onlyWithModificator) { // return false if key not executed
199 executed = false;
200
201 final VirtualList current = VirtualCanvas.getInstance().getList();
202 if (current instanceof UserKeyEdit) {
203 if (((UserKeyEdit) current).key(key)) {
204 executed = true;
205 return executed;
206 }
207 }
208
209 Vector keysList = keyScheme.getKeysList();
210 int modificatorCode = keyScheme.getModificator().key;
211 int size = keyScheme.getSize();
212
213 if (previousKeyCode == modificatorCode) {
214 for (int i = 0; i < size; i++) {
215 UserKey u = ((UserKey) keysList.elementAt(i));
216 if (u.equals(key, true))
217 executed = commandExecute(u.command_id) || executed;
218 }
219 } else if (!onlyWithModificator) {
220 for (int i = 0; i < size; i++) {
221 UserKey u = ((UserKey) keysList.elementAt(i));
222 if (u.equals(key, false))
223 executed = commandExecute(u.command_id) || executed;
224 }
225 }
226
227 return executed;
228 }
229
230 private boolean commandExecute(int command_id) {
231 Config cf = Config.getInstance();

Callers 2

keyPressedMethod · 0.80
doKeyActionMethod · 0.80

Calls 8

getInstanceMethod · 0.95
equalsMethod · 0.95
commandExecuteMethod · 0.95
getKeysListMethod · 0.80
getModificatorMethod · 0.80
getListMethod · 0.45
keyMethod · 0.45
getSizeMethod · 0.45

Tested by

no test coverage detected