Sha256: a011966cbfb60b80edbb371253f450c6785bd8cdbc256f07268039fd9789dafa
Contents?: true
Size: 1.49 KB
Versions: 28
Compression:
Stored size: 1.49 KB
Contents
module Appium module Core class Base module Device module KeyEvent # Only for Selendroid def keyevent(key, metastate = nil) args = { keycode: key } args[:metastate] = metastate if metastate execute :keyevent, {}, args end def press_keycode(key, metastate: [], flags: []) raise ArgumentError, 'flags should be Array' unless flags.is_a? Array raise ArgumentError, 'metastates should be Array' unless metastate.is_a? Array args = { keycode: key } args[:metastate] = metastate.reduce(0) { |acc, meta| acc | meta } unless metastate.empty? args[:flags] = flags.reduce(0) { |acc, flag| acc | flag } unless flags.empty? execute :press_keycode, {}, args end def long_press_keycode(key, metastate: [], flags: []) raise ArgumentError, 'flags should be Array' unless flags.is_a? Array raise ArgumentError, 'metastates should be Array' unless metastate.is_a? Array args = { keycode: key } args[:metastate] = metastate.reduce(0) { |acc, meta| acc | meta } unless metastate.empty? args[:flags] = flags.reduce(0) { |acc, flag| acc | flag } unless flags.empty? execute :long_press_keycode, {}, args end end # module KeyEvent end # module Device end # class Base end # module Core end # module Appium
Version data entries
28 entries across 28 versions & 1 rubygems