public KeyType(String keyString, boolean h) { Keyboard key = null; if (keyString.equalsIgnoreCase("left")) key = Keyboard.MOUSE_LEFT; else if (keyString.equalsIgnoreCase("right")) key = Keyboard.MOUSE_RIGHT; else if (keyString.equalsIgnoreCase("middle")) key = Keyboard.MOUSE_MIDDLE; else key = Keyboard.valueOf("KEY_" + keyString.toUpperCase()); this.key = key; this.hold = h; }
public SMSSpoutKeyMap(String definition) { keys = new HashSet<Keyboard>(); if (definition == null || definition.isEmpty()) { return; } String[] wanted = definition.split("\\+"); for (String w : wanted) { w = w.toUpperCase(); if (!w.startsWith("KEY_")) w = "KEY_" + w; keys.add(Keyboard.valueOf(w)); } }