Class: Puppeteer::Keyboard::KeyDefinition

Inherits:
Object
  • Object
show all
Defined in:
lib/puppeteer/keyboard/us_keyboard_layout.rb

Overview

  • @typedef Object KeyDefinition

  • @property number= keyCode

  • @property number= shiftKeyCode

  • @property string= key

  • @property string= shiftKey

  • @property string= code

  • @property string= text

  • @property string= shiftText

  • @property number= location

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ KeyDefinition

Returns a new instance of KeyDefinition.



12
13
14
15
16
17
18
19
20
21
# File 'lib/puppeteer/keyboard/us_keyboard_layout.rb', line 12

def initialize(hash)
  @key_code = hash[:keyCode]
  @shift_key_code = hash[:shiftKeyCode]
  @key = hash[:key]
  @shift_key = hash[:shiftKey]
  @code = hash[:code]
  @text = hash[:text]
  @shift_text = hash[:shiftText]
  @location = hash[:location]
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



23
24
25
# File 'lib/puppeteer/keyboard/us_keyboard_layout.rb', line 23

def code
  @code
end

#keyObject (readonly)

Returns the value of attribute key.



23
24
25
# File 'lib/puppeteer/keyboard/us_keyboard_layout.rb', line 23

def key
  @key
end

#key_codeObject (readonly)

Returns the value of attribute key_code.



23
24
25
# File 'lib/puppeteer/keyboard/us_keyboard_layout.rb', line 23

def key_code
  @key_code
end

#locationObject (readonly)

Returns the value of attribute location.



23
24
25
# File 'lib/puppeteer/keyboard/us_keyboard_layout.rb', line 23

def location
  @location
end

#shift_keyObject (readonly)

Returns the value of attribute shift_key.



23
24
25
# File 'lib/puppeteer/keyboard/us_keyboard_layout.rb', line 23

def shift_key
  @shift_key
end

#shift_key_codeObject (readonly)

Returns the value of attribute shift_key_code.



23
24
25
# File 'lib/puppeteer/keyboard/us_keyboard_layout.rb', line 23

def shift_key_code
  @shift_key_code
end

#shift_textObject (readonly)

Returns the value of attribute shift_text.



23
24
25
# File 'lib/puppeteer/keyboard/us_keyboard_layout.rb', line 23

def shift_text
  @shift_text
end

#textObject (readonly)

Returns the value of attribute text.



23
24
25
# File 'lib/puppeteer/keyboard/us_keyboard_layout.rb', line 23

def text
  @text
end