

To send keystroke tab: key_stroke( 'tab') You can use two click calls: left_click left_clickĪnd of course if for some reasons you need double middle mouse click, you can: middle_click middle_clickįor get more refined control to key strokes simulation, you can use the method key_stroke, key_up and key_down methods To perform a double_click, instead of using: double_click If you wish to left click and hold: mouse_down( :left)Īnd remember to release the button later: mouse_up( :left)

Yes this is not very efficient but mouse_move_relative methods will be implemented in later releases. To move the mouse cursor downward 300 pixels mouse_move( cursor_position +300, cursor_position) To show the current cursor x and y position in pixels: puts cursor_position The methods shown in Basic Usage are convenient, but sometimes you may need more control on your mouse actions and key strokes. For example, to type #''\, you can either do: type( '#\'\'\\') Notice that you need to escape the character \ and ' in single quote string, and you need to escape \ “ and # in double quote string. It will ensure that the capslock is off and hold shift when it is typing a capital character or a character that need shift down (e.g. The type method will Send keystroke for every characters of the string. So that you do not need to use this left click things to get focus on the notepad window.….in later release.….) mouse_move( 100, 100) (Methods like get_windows(“notepad”) will be implemented in future release. Suppose the notepad window on the top left corner of the screen, to type “Auto Click” in notepad. To get the current cursor position cursor_position To scroll down (backward) 5 wheel steps: mouse_scroll( -5) To scroll up (forward) 10 wheel steps: mouse_scroll( 10) To move the mouse cursor to the middle of the screen: mouse_move_percentage( 0.5, 0.5) To move the mouse cursor to 50,50 and perform a right click: mouse_move( 50, 50) To move the mouse cursor to 50,50 ( the top left corner is 0,0) and perform a double left click: mouse_move( 50, 50) You need to require the gem and include the module: require 'auto_click' include AutoClickMethods To use the methods provided by auto_click.

To update auto_click: gem update auto_click Basic Usage ¶ ↑ To install auto_click: gem install auto_click Smulating mouse click, cursor movement and keystrokes Install ¶ ↑
