lib/fusuma/plugin/executors/sendkey_executor.rb in fusuma-plugin-sendkey-0.1.0 vs lib/fusuma/plugin/executors/sendkey_executor.rb in fusuma-plugin-sendkey-0.1.1

- old
+ new

@@ -5,10 +5,16 @@ module Fusuma module Plugin module Executors # Control Window or Workspaces by executing wctrl class SendkeyExecutor < Executor + def config_param_types + { + 'device_path': String + } + end + # execute sendkey command # @param event [Event] # @return [nil] def execute(event) return if search_command(event).nil? @@ -33,10 +39,13 @@ # @param event [Event] # @return [String] # @return [NilClass] def search_command(event) - @keyboard ||= Keyboard.new + @keyboard ||= begin + device = Sendkey::Device.new(path: config_params(:device_path)) + Sendkey::Keyboard.new(device: device) + end @keyboard.type_command(param: search_param(event)) end private