Method: Ferrum::Keyboard#down

Defined in:
lib/ferrum/keyboard.rb

#down(key) ⇒ self

Dispatches a keydown event.

Parameters:

  • key (String, Symbol)

    Name of the key, such as ‘“a”`, :enter, or :backspace.

Returns:

  • (self)


41
42
43
44
45
46
# File 'lib/ferrum/keyboard.rb', line 41

def down(key)
  key = normalize_keys(Array(key)).first
  type = key[:text] ? "keyDown" : "rawKeyDown"
  @page.command("Input.dispatchKeyEvent", slowmoable: true, type: type, **key)
  self
end