# :stopdoc: # This file is automatically generated by the WXRuby3 documentation # generator. Do not alter this file. # :startdoc: module Wx # {Wx::UIActionSimulator} is a class used to simulate user interface actions such as a mouse click or a key press. # Common usage for this class would be to provide playback and record (aka macro recording) functionality for users, or to drive unit tests by simulating user sessions. # See the wxUIActionSimulator Sample for an example of using this class. # This class currently doesn't work when using Wayland with wxGTK. # # === # # # @note This class is untracked and should not be derived from nor instances extended! class UIActionSimulator < ::Object # Default constructor. # @return [Wx::UIActionSimulator] def initialize; end # @overload mouse_move(x, y) # Move the mouse to the specified coordinates. # @param x [Integer] x coordinate to move to, in screen coordinates. # @param y [Integer] y coordinate to move to, in screen coordinates. # @return [Boolean] # @overload mouse_move(point) # Move the mouse to the specified coordinates. # @param point [Array(Integer, Integer), Wx::Point] Point to move to, in screen coordinates. # @return [Boolean] def mouse_move(*args) end # Press a mouse button. # @param button [Integer] Button to press. Valid constants are {Wx::MouseButton::MOUSE_BTN_LEFT}, {Wx::MouseButton::MOUSE_BTN_MIDDLE}, and {Wx::MouseButton::MOUSE_BTN_RIGHT}. # @return [Boolean] def mouse_down(button=Wx::MouseButton::MOUSE_BTN_LEFT) end # Release a mouse button. # @param button [Integer] Button to press. See {Wx::UIActionSimulator#mouse_down} for a list of valid constants. # @return [Boolean] def mouse_up(button=Wx::MouseButton::MOUSE_BTN_LEFT) end # Click a mouse button. # @param button [Integer] Button to press. See {Wx::UIActionSimulator#mouse_down} for a list of valid constants. # @return [Boolean] def mouse_click(button=Wx::MouseButton::MOUSE_BTN_LEFT) end # Double-click a mouse button. # @param button [Integer] Button to press. See {Wx::UIActionSimulator#mouse_down} for a list of valid constants. # @return [Boolean] def mouse_dbl_click(button=Wx::MouseButton::MOUSE_BTN_LEFT) end # Perform a drag and drop operation. # @param x1 [Integer] x start coordinate, in screen coordinates. # @param y1 [Integer] y start coordinate, in screen coordinates. # @param x2 [Integer] x destination coordinate, in screen coordinates. # @param y2 [Integer] y destination coordinate, in screen coordinates. # @param button [Integer] Button to press. See {Wx::UIActionSimulator#mouse_down} for a list of valid constants. # @return [Boolean] def mouse_drag_drop(x1, y1, x2, y2, button=Wx::MouseButton::MOUSE_BTN_LEFT) end # Press a key. # If you are using modifiers then it needs to be paired with an identical KeyUp or the modifiers will not be released (MSW and macOS). # @param keycode [Integer] Key to operate on, as an integer. It is interpreted as a {Wx::KeyCode}. # @param modifiers [Integer] A combination of {Wx::KeyModifier} flags to be pressed with the given keycode. # @return [Boolean] def key_down(keycode, modifiers=Wx::KeyModifier::MOD_NONE) end # Release a key. # @param keycode [Integer] Key to operate on, as an integer. It is interpreted as a {Wx::KeyCode}. # @param modifiers [Integer] A combination of {Wx::KeyModifier} flags to be pressed with the given keycode. # @return [Boolean] def key_up(keycode, modifiers=Wx::KeyModifier::MOD_NONE) end # Press and release a key. # @param keycode [Integer] Key to operate on, as an integer. It is interpreted as a {Wx::KeyCode}. # @param modifiers [Integer] A combination of {Wx::KeyModifier} flags to be pressed with the given keycode. # @return [Boolean] def char(keycode, modifiers=Wx::KeyModifier::MOD_NONE) end # Simulate selection of an item with the given text. # This method selects an item in the currently focused {Wx::Choice}, {Wx::ComboBox}, {Wx::ListBox} and similar controls. It does it by simulating keyboard events, so the behaviour should be the same as if the item was really selected by the user. # Notice that the implementation of this method uses {yield} and so events can be dispatched from it. # # true if the item text was successfully selected or false if the currently focused window is not one of the controls allowing item selection or if the item with the given text was not found in it. # @param text [String] The text of the item to select. # @return [Boolean] def select(text) end # Emulate typing in the keys representing the given string. # Currently only the ASCII letters are universally supported. Digits and punctuation characters can be used with the standard QWERTY (US) keyboard layout but may not work with other layouts. # @param text [String] The string, containing only US ASCII characters, to type. # @return [Boolean] def text(text) end end # UIActionSimulator end