View Javadoc

1   package com.atlassian.selenium.keyboard;
2   
3   import com.atlassian.selenium.Browser;
4   import com.atlassian.webtest.ui.keys.KeyEventType;
5   
6   import java.util.Set;
7   
8   /**
9    * TODO: Document this class / interface here
10   *
11   */
12  public class KeyEvent
13  {
14      public KeyEvent()
15      {
16      }
17  
18      public KeyEvent(final KeyEventType eventType, final int code, final Set<Browser> browsers, final boolean shiftKeyDown, final boolean altKeyDown, final boolean ctrlKeyDown, final boolean metaKey, final boolean toKeyCode, final boolean toCharacterCode)
19      {
20          this.eventType = eventType;
21          this.code = code;
22          this.shiftKeyDown = shiftKeyDown;
23          this.altKeyDown = altKeyDown;
24          this.ctrlKeyDown = ctrlKeyDown;
25          this.metaKey = metaKey;
26          this.toKeyCode = toKeyCode;
27          this.toCharacterCode = toCharacterCode;
28          this.browsers = browsers;
29      }
30  
31      private KeyEventType eventType;
32      private int code;
33      private boolean shiftKeyDown;
34      private boolean altKeyDown;
35      private boolean ctrlKeyDown;
36      private boolean metaKey;
37      private boolean toKeyCode;
38      private boolean toCharacterCode;
39      private Set<Browser> browsers;
40  
41      public boolean isToCharacterCode()
42      {
43          return toCharacterCode;
44      }
45  
46      public boolean isToKeyCode()
47      {
48          return toKeyCode;
49  
50      }
51  
52      public Set<Browser> getBrowsers()
53      {
54  
55          return browsers;
56      }
57  
58  
59  
60      public boolean isMetaKey()
61      {
62          return metaKey;
63      }
64  
65  
66      public KeyEventType getEventType()
67      {
68          return eventType;
69      }
70  
71  
72      public int getCode()
73      {
74          return code;
75      }
76  
77  
78      public boolean isShiftKeyDown()
79      {
80          return shiftKeyDown;
81      }
82  
83  
84      public boolean isAltKeyDown()
85      {
86          return altKeyDown;
87      }
88  
89  
90      public boolean isCtrlKeyDown()
91      {
92          return ctrlKeyDown;
93      }
94  
95  }