Ignore:
Timestamp:
11/13/14 15:27:33 (10 years ago)
Author:
pharms
Message:
  • corrected handling of key press events
Location:
trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/eventcore
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/eventcore/HTMLEventTypeFactory.java

    r1435 r1824  
    3434import de.ugoe.cs.autoquest.eventcore.guimodel.ITextArea; 
    3535import de.ugoe.cs.autoquest.eventcore.guimodel.ITextField; 
    36 import de.ugoe.cs.autoquest.keyboardmaps.VirtualKey; 
    3736import de.ugoe.cs.util.console.Console; 
    3837 
     
    126125        } 
    127126        else if ("onkeydown".equals(eventName)) { 
    128             try { 
    129                 int key = Integer.parseInt(eventParameters.get("key")); 
    130                 result = new KeyPressed(VirtualKey.valueOf(key)); 
    131             } 
    132             catch (NumberFormatException e) { 
    133                 throw new IllegalArgumentException("the key id provided by an " + eventName + 
    134                                                    " is no correct integer"); 
    135             } 
     127            result = new KeyPressed 
     128                (HTMLVirtualKey.parseVirtualKey(eventParameters.get("key")).getKey()); 
    136129        } 
    137130        else if ("onfocus".equals(eventName)) { 
Note: See TracChangeset for help on using the changeset viewer.