Chris@0: findElement($xpath, 1); Chris@0: $key = $this->normalizeCharForKeyEvent($char); Chris@0: $modifier = $this->keyEventModifierControl($modifier); Chris@0: return $this->browser->keyEvent($element["page_id"], $element["ids"][0], "keydown", $key, $modifier); Chris@0: } Chris@0: Chris@0: /** Chris@0: * @param string $xpath Chris@0: * @param string $char Chris@0: * @param string $modifier Chris@0: * @throws DriverException Chris@0: */ Chris@0: public function keyPress($xpath, $char, $modifier = null) { Chris@0: $element = $this->findElement($xpath, 1); Chris@0: $key = $this->normalizeCharForKeyEvent($char); Chris@0: $modifier = $this->keyEventModifierControl($modifier); Chris@0: return $this->browser->keyEvent($element["page_id"], $element["ids"][0], "keypress", $key, $modifier); Chris@0: } Chris@0: Chris@0: /** Chris@0: * Pressed up specific keyboard key. Chris@0: * Chris@0: * @param string $xpath Chris@0: * @param string|integer $char could be either char ('b') or char-code (98) Chris@0: * @param string $modifier keyboard modifier (could be 'ctrl', 'alt', 'shift' or 'meta') Chris@0: * Chris@0: * @throws DriverException When the operation cannot be done Chris@0: */ Chris@0: public function keyUp($xpath, $char, $modifier = null) { Chris@0: $this->findElement($xpath, 1); Chris@0: $element = $this->findElement($xpath, 1); Chris@0: $key = $this->normalizeCharForKeyEvent($char); Chris@0: $modifier = $this->keyEventModifierControl($modifier); Chris@0: return $this->browser->keyEvent($element["page_id"], $element["ids"][0], "keyup", $key, $modifier); Chris@0: } Chris@0: }