Class: Fusuma::Plugin::Remap::KeyboardRemapper::TouchpadSelector
- Inherits:
-
Object
- Object
- Fusuma::Plugin::Remap::KeyboardRemapper::TouchpadSelector
- Defined in:
- lib/fusuma/plugin/remap/keyboard_remapper.rb
Instance Method Summary collapse
-
#initialize(names = nil) ⇒ TouchpadSelector
constructor
A new instance of TouchpadSelector.
- #select ⇒ Array<Revdev::EventDevice>
Constructor Details
#initialize(names = nil) ⇒ TouchpadSelector
Returns a new instance of TouchpadSelector.
344 345 346 |
# File 'lib/fusuma/plugin/remap/keyboard_remapper.rb', line 344 def initialize(names = nil) @names = names end |
Instance Method Details
#select ⇒ Array<Revdev::EventDevice>
349 350 351 352 353 354 355 356 357 358 |
# File 'lib/fusuma/plugin/remap/keyboard_remapper.rb', line 349 def select devices = if @names Fusuma::Device.all.select { |d| Array(@names).any? { |name| d.name =~ /#{name}/ } } else # available returns only touchpad devices Fusuma::Device.available end devices.map { |d| Revdev::EventDevice.new("/dev/input/#{d.id}") } end |