nl.praegus.fitnesse.slim.util.KeyMapping Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of toolchain-appium-fixtures Show documentation
Show all versions of toolchain-appium-fixtures Show documentation
Fixtures to assist in android, iOS and windows app testing via FitNesse
package nl.praegus.fitnesse.slim.util;
import nl.hsac.fitnesse.fixture.slim.SlimFixtureException;
import java.awt.event.KeyEvent;
import java.util.HashMap;
import java.util.Map;
public class KeyMapping {
private KeyMapping() {
// constructor is private cause everything is static
}
private static Map keyMap = new HashMap<>();
static {
keyMap.put("control", KeyEvent.VK_CONTROL);
keyMap.put("v", KeyEvent.VK_V);
}
public static Integer getKey(String key) {
Integer keyStoke = keyMap.get(key.toLowerCase().trim());
if (keyStoke != null) {
return keyStoke;
}
throw new SlimFixtureException("Key: " + key + " does not exist or is not supported yet");
}
}