(int key, boolean onlyWithModificator)
| 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(); |
no test coverage detected