You are here

public function KeyboardTrait::keyDown in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/jcalderonzumba/mink-phantomjs-driver/src/KeyboardTrait.php \Zumba\Mink\Driver\KeyboardTrait::keyDown()

Send a key-down event to the browser element

Parameters

$xpath:

$char:

string $modifier:

Throws

DriverException

File

vendor/jcalderonzumba/mink-phantomjs-driver/src/KeyboardTrait.php, line 59

Class

KeyboardTrait
Class KeyboardTrait @package Zumba\Mink\Driver

Namespace

Zumba\Mink\Driver

Code

public function keyDown($xpath, $char, $modifier = null) {
  $element = $this
    ->findElement($xpath, 1);
  $key = $this
    ->normalizeCharForKeyEvent($char);
  $modifier = $this
    ->keyEventModifierControl($modifier);
  return $this->browser
    ->keyEvent($element["page_id"], $element["ids"][0], "keydown", $key, $modifier);
}