Class: Hokusai::Automation::DriverCommands::TriggerMouseWheel

Inherits:
Base
  • Object
show all
Defined in:
ui/src/hokusai/automation/driver_commands/trigger_mouse.rb

Instance Attribute Summary

Attributes inherited from Base

#last_parent, #request_id, #state, #status

Instance Method Summary collapse

Methods inherited from Base

#initialize, #matches_block, #matches_blocks, #mouse_center, #mouse_move

Constructor Details

This class inherits a constructor from Hokusai::Automation::DriverCommands::Base

Instance Method Details

#execute(blocks, canvas, input) ⇒ Object



202
203
204
205
206
207
208
209
210
# File 'ui/src/hokusai/automation/driver_commands/trigger_mouse.rb', line 202

def execute(blocks, canvas, input)
  if matches_block(blocks[0])
    mouse_center(canvas, input)
    LibHokusai.hoku_input_mouse_set_scroll(input, scroll_amount)


    done!
  end
end

#locationObject



188
189
190
# File 'ui/src/hokusai/automation/driver_commands/trigger_mouse.rb', line 188

def location
  state[:uuid]
end

#on_completeObject



196
197
198
199
200
# File 'ui/src/hokusai/automation/driver_commands/trigger_mouse.rb', line 196

def on_complete
  return true if done?

  return Automation::Error.new("Could not locate block")
end

#scroll_amountObject



192
193
194
# File 'ui/src/hokusai/automation/driver_commands/trigger_mouse.rb', line 192

def scroll_amount
  state[:scroll_amount]
end