Class: Fusuma::Plugin::Events::Records::KeypressRecord

Inherits:
Record
  • Object
show all
Defined in:
lib/fusuma/plugin/events/records/keypress_record.rb

Overview

Record for Keypress event

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status:, code:, layer: nil) ⇒ KeypressRecord

Returns a new instance of KeypressRecord.

Examples:

KeypressRecord.new(status: 'pressed', code: 'LEFTSHIFT', layer: 'thumbsense')

Parameters:

  • status (String)

    ‘pressed’ or ‘released’

  • code (String)
  • layer (Hash) (defaults to: nil)

    this field will be used from other plugin.



17
18
19
20
21
22
# File 'lib/fusuma/plugin/events/records/keypress_record.rb', line 17

def initialize(status:, code:, layer: nil)
  super()
  @status = status
  @code = code
  @layer = layer
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



9
10
11
# File 'lib/fusuma/plugin/events/records/keypress_record.rb', line 9

def code
  @code
end

#layerObject (readonly)

Returns the value of attribute layer.



9
10
11
# File 'lib/fusuma/plugin/events/records/keypress_record.rb', line 9

def layer
  @layer
end

#statusObject (readonly)

Returns the value of attribute status.



9
10
11
# File 'lib/fusuma/plugin/events/records/keypress_record.rb', line 9

def status
  @status
end

Instance Method Details

#to_sObject



24
25
26
# File 'lib/fusuma/plugin/events/records/keypress_record.rb', line 24

def to_s
  "#{status} #{code} #{layer}"
end