Skip to content

Commit

Permalink
Merge pull request #11 from iberianpig/feature/add_layer_to_record
Browse files Browse the repository at this point in the history
Add Layer Information to Key Press Events
  • Loading branch information
iberianpig authored Jan 20, 2024
2 parents 74f0eb0 + 4a210c3 commit 7ef264b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/fusuma/plugin/events/records/keypress_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ module Events
module Records
# Record for Keypress event
class KeypressRecord < Record
attr_reader :status, :code
attr_reader :status, :code, :layer

# @example
# KeypressRecord.new(status: 'pressed', code: 'LEFTSHIFT')
# KeypressRecord.new(status: 'pressed', code: 'LEFTSHIFT', layer: 'thumbsense')
#
# @param status [String]
# @param status [String] 'pressed' or 'released'
# @param code [String]
# @param layer [Hash] this field will be used from other plugin.
def initialize(status:, code:, layer: nil)
super()
@status = status
Expand All @@ -21,7 +22,7 @@ def initialize(status:, code:, layer: nil)
end

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

0 comments on commit 7ef264b

Please sign in to comment.