Changeset 1701
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-misc/src/main/java/de/ugoe/cs/autoquest/keyboardmaps/VirtualKey.java
r927 r1701 289 289 /** 290 290 * <p> 291 * Returns the keyCode of the virtual key. 292 * </p> 293 * 294 * @return the keyCode. 295 */ 296 public int getVirtualKeyCode() { 297 return virtualKeyCode; 298 } 299 300 /** 301 * <p> 291 302 * Returns whether the key is a combination key (e.g., shift, alt) or not. 292 303 * </p> -
trunk/autoquest-plugin-jfc/src/main/java/de/ugoe/cs/autoquest/plugin/jfc/commands/CMDgenerateJacaretoReplay.java
r1691 r1701 91 91 private JFCGUIElement currentFocus; 92 92 private StructureNode structure; 93 private StructureNode lastKeySequenceEvent; 94 private StructureNode lastKeyTypedEvent; 93 95 private StructureNode lastMouseClickEvent; 94 96 private StructureNode lastFocusChangeEvent; … … 180 182 181 183 if (event.getType() instanceof MouseButtonDown) { 184 lastKeySequenceEvent = null; 185 182 186 lastMouseClickEvent = new StructureNode("MouseClick"); 183 187 writeMouseClickEvent(writer, event, 501); 184 188 } 185 189 else if (event.getType() instanceof MouseButtonUp) { 190 lastKeySequenceEvent = null; 191 186 192 writeMouseClickEvent(writer, event, 502); 187 193 } 188 194 else if (event.getType() instanceof MouseClick) { 195 lastKeySequenceEvent = null; 196 189 197 writeMouseClickEvent(writer, event, 500); 190 198 // FIXME: don't always write an item action … … 207 215 } 208 216 else if (event.getType() instanceof KeyboardFocusChange) { 217 lastKeySequenceEvent = null; 218 209 219 writeFocusChangeEvent(writer, event); 210 220 } 211 221 else if (event.getType() instanceof KeyPressed) { 212 // writeKeyEvent(writer, event, 401); 222 if (lastKeySequenceEvent == null) { 223 lastKeySequenceEvent = structure.add("KeySequence"); 224 } 225 lastKeyTypedEvent = lastKeySequenceEvent.add("KeyTyped"); 226 writeKeyEvent(writer, event, 401); 213 227 } 214 228 else if (event.getType() instanceof KeyReleased) { 215 //writeKeyEvent(writer, event, 402);229 writeKeyEvent(writer, event, 402); 216 230 } 217 231 } … … 445 459 writeLine(writer, 446 460 "<KeyInfo " 447 + "keyCode=\"" + getKeyCode(info.getKey()) + "\" "448 + "keyChar=\"" + getKeyChar(info.getKey() ) + "\" "461 + "keyCode=\"" + info.getKey().getVirtualKeyCode() + "\" " 462 + "keyChar=\"" + getKeyChar(info.getKey().getVirtualKeyCode()) + "\" " 449 463 + "modifiers=\"0\" />" 450 464 ); … … 452 466 writeLine(writer, "</KeyEvent>"); 453 467 454 // TODO: keyevent structure part468 lastKeyTypedEvent.addRecordable(); 455 469 } 456 470 457 private String getKeyChar (VirtualKey key) { 458 // TODO 459 return ""; 460 } 461 462 private int getKeyCode (VirtualKey key) { 463 // TODO 464 return -1; 471 private String getKeyChar (int keyCode) { 472 if (keyCode >= 32 && keyCode < 127) { 473 return String.valueOf((char)keyCode); 474 } 475 else { 476 return "_NO_LEGAL_XML_CHAR"; 477 } 465 478 } 466 479 }
Note: See TracChangeset
for help on using the changeset viewer.