Class: Karabiner::Remap

Inherits:
Property show all
Defined in:
lib/karabiner/remap.rb

Instance Attribute Summary

Attributes inherited from Property

#attr, #value

Instance Method Summary collapse

Methods inherited from Property

#to_xml

Methods included from XmlTree

#add_child, #search_childs, #to_xml

Constructor Details

#initialize(from, to) ⇒ Remap

Returns a new instance of Remap.



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/karabiner/remap.rb', line 5

def initialize(from, to)
  tos = [to].flatten

  super(
    "autogen",
    [
      "__KeyToKey__ #{Karabiner::Key.new(from)}",
      *tos.map { |to| Karabiner::Key.new(to) },
    ].join(", "),
  )
end