Ignore:
Timestamp:
07/04/13 16:22:42 (11 years ago)
Author:
pharms
Message:
  • update to HTML 5 and parsing of key presses
File:
1 edited

Legend:

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

    r1247 r1250  
    2020import de.ugoe.cs.autoquest.eventcore.IEventType; 
    2121import de.ugoe.cs.autoquest.eventcore.gui.IInteraction; 
     22import de.ugoe.cs.autoquest.eventcore.gui.KeyPressed; 
    2223import de.ugoe.cs.autoquest.eventcore.gui.KeyboardFocusChange; 
    2324import de.ugoe.cs.autoquest.eventcore.gui.MouseButtonInteraction; 
     
    3334import de.ugoe.cs.autoquest.eventcore.guimodel.ITextArea; 
    3435import de.ugoe.cs.autoquest.eventcore.guimodel.ITextField; 
     36import de.ugoe.cs.autoquest.keyboardmaps.VirtualKey; 
    3537import de.ugoe.cs.util.console.Console; 
    3638 
     
    112114            } 
    113115        } 
     116        else if ("onkeydown".equals(eventName)) { 
     117            try { 
     118                int key = Integer.parseInt(eventParameters.get("key")); 
     119                result = new KeyPressed(VirtualKey.valueOf(key)); 
     120            } 
     121            catch (NumberFormatException e) { 
     122                throw new IllegalArgumentException("the key id provided by an " + eventName + 
     123                                                   " is no correct integer"); 
     124            } 
     125        } 
    114126        else if ("onfocus".equals(eventName)) { 
    115127            result = new KeyboardFocusChange(); 
Note: See TracChangeset for help on using the changeset viewer.