Class: Dommy::KeyboardEvent
Constant Summary
Constants inherited from Event
Instance Attribute Summary
Attributes inherited from Event
Instance Method Summary collapse
- #__js_get__(key) ⇒ Object
-
#initialize(type, init = nil) ⇒ KeyboardEvent
constructor
A new instance of KeyboardEvent.
Methods inherited from Event
#__internal_prepare_for_dispatch__, #__internal_record_path__, #__internal_set_current_target__, #__js_call__, #__js_method_names__, #__js_set__, #bubbles?, #default_prevented?, #immediate_propagation_stopped?, #init_event, #propagation_stopped?
Constructor Details
#initialize(type, init = nil) ⇒ KeyboardEvent
Returns a new instance of KeyboardEvent.
439 440 441 442 443 444 445 446 |
# File 'lib/dommy/event.rb', line 439 def initialize(type, init = nil) super @key = read_init(init, "key").to_s @ctrl_key = !!read_init(init, "ctrlKey") @shift_key = !!read_init(init, "shiftKey") @alt_key = !!read_init(init, "altKey") @meta_key = !!read_init(init, "metaKey") end |
Instance Method Details
#__js_get__(key) ⇒ Object
448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 |
# File 'lib/dommy/event.rb', line 448 def __js_get__(key) case key when "key" @key when "ctrlKey" @ctrl_key when "shiftKey" @shift_key when "altKey" @alt_key when "metaKey" @meta_key else super end end |