lib/puppeteer/keyboard.rb in puppeteer-ruby-0.44.3 vs lib/puppeteer/keyboard.rb in puppeteer-ruby-0.45.0

- old
+ new

@@ -13,11 +13,11 @@ attr_reader :modifiers # @param key [String] # @param text [String] - def down(key, text: nil) + def down(key, text: nil, commands: nil) description = key_description_for_string(key) auto_repeat = @pressed_keys.include?(description.code) @pressed_keys << description.code @modifiers |= modifier_bit(description.key) @@ -32,10 +32,11 @@ text: sending_text, unmodifiedText: sending_text, autoRepeat: auto_repeat, location: description.location, isKeypad: description.location == 3, + commands: commands, }.compact @client.send_message('Input.dispatchKeyEvent', params) end define_async_method :async_down @@ -149,11 +150,11 @@ define_async_method :async_type_text # @param key [String] # @param text [String] # @return [Future] - def press(key, delay: nil, text: nil) - down(key, text: text) + def press(key, delay: nil, text: nil, commands: nil) + down(key, text: text, commands: commands) if delay sleep(delay.to_i / 1000.0) end up(key) end