lib/fusuma/plugin/inputs/libinput_command_input.rb in fusuma-1.2.1 vs lib/fusuma/plugin/inputs/libinput_command_input.rb in fusuma-1.3.0

- old
+ new

@@ -8,13 +8,14 @@ module Inputs # libinput commands wrapper class LibinputCommandInput < Input def config_param_types { - 'enable-tap': [TrueClass, FalseClass], + 'device': [String], 'enable-dwt': [TrueClass, FalseClass], - 'device': [String] + 'enable-tap': [TrueClass, FalseClass], + 'show-keycodes': [TrueClass, FalseClass] } end def run debug_events do |line| @@ -86,23 +87,23 @@ else 'libinput-debug-events' end end - private - - # TODO: add specs def libinput_options + device = ("--device='#{config_params(:device)}'" if config_params(:device)) enable_tap = '--enable-tap' if config_params(:'enable-tap') - device = ("--device=#{config_params(:device)}" if config_params(:device)) enable_dwt = '--enable-dwt' if config_params(:'enable-dwt') - + show_keycodes = '--show-keycodes' if config_params(:'show-keycodes') [ - enable_tap, device, - enable_dwt + enable_dwt, + enable_tap, + show_keycodes ].compact end + + private # which in ruby: Checking if program exists in $PATH from ruby # (https://stackoverflow.com/questions/2108727/which-in-ruby-checking-if-program-exists-in-path-from-ruby) # Cross-platform way of finding an executable in the $PATH. #