Class: Selenium::WebDriver::Interactions::KeyInput Private

Inherits:
InputDevice
  • Object
show all
Defined in:
rb/lib/selenium/webdriver/common/interactions/key_input.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Creates actions specific to Key Input devices

Defined Under Namespace

Classes: TypingInteraction

Constant Summary collapse

SUBTYPES =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

{down: :keyDown, up: :keyUp, pause: :pause}.freeze

Instance Attribute Summary

Attributes inherited from InputDevice

#actions, #name, #type

Instance Method Summary collapse

Methods inherited from InputDevice

#add_action, #clear_actions, #create_pause, #encode

Constructor Details

#initialize(name = nil) ⇒ KeyInput

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of KeyInput.



32
33
34
35
# File 'rb/lib/selenium/webdriver/common/interactions/key_input.rb', line 32

def initialize(name = nil)
  super
  @type = Interactions::KEY
end

Instance Method Details

#create_key_down(key) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



37
38
39
# File 'rb/lib/selenium/webdriver/common/interactions/key_input.rb', line 37

def create_key_down(key)
  add_action(TypingInteraction.new(self, :down, key))
end

#create_key_up(key) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



41
42
43
# File 'rb/lib/selenium/webdriver/common/interactions/key_input.rb', line 41

def create_key_up(key)
  add_action(TypingInteraction.new(self, :up, key))
end