# <H1 align="center">«Clicker» module</h1> 

<p>	The «Clicker» is used to record a sequence of actions, performed by a user, those actions include mouse button clicks and typing on a keyboard. With the help of this module you can interact with any software, because this module mimics the actions of a user, meaning that if you can do this «Clicker» can too.</p>
<p>	The use of clicker robots is recommended on monitors with the same resolution as the one a robot was written on.</p>

## Creating a macros 
<p>When you open the «Clicker» module the «Record macros actions» dialog window will open up. The dialog window consists of three elements – the «Start recording» button, the area in which the recorded actions will be displayed, and the «Save» button.</p>
<H1 align="center">![Screenshot](img/clicker_1.png)</h1> 
<p>By clicking the «Start recording» button, software will wait for you to press «TAB», after you press «TAB» the dialog window for making a new command (action) will open up. </p>
<H1 align="center">![Screenshot](img/clicker_2.png)</h1> 
<p>In this dialog window you can configure the command (detailed description of all actions is gonna be listed below). After you create a command and press the save button, a new action will be added to the macros.</p>
<H1 align="center">![Screenshot](img/clicker_3.png)</h1> 
<p>You can change the position of an action in the list of commands using the arrow buttons located on the right side of the block.</p>
<H1 align="center">![Screenshot](img/clicker_4.png)</h1> 
<p>A button with a cross on it is used to remove an action from the list of commands.</p>
<p>To save the macros press the «Save» button.</p>
## Creating a command
<p>Window for creating a command consists of static and non static fields. «Action», «Pause» and «Note» are static fields.</p>
## Static fields
### Action 
<p>The «Action» field consists of a list of available actions for recording a macros – typing and clicking, most common hotkeys (copy, paste). All of the available actions in this module will be listed below.</p>
### Pause
<p>The «Pause» field is designed for creating a pause after an executed command.  The pause is specified in milliseconds.</p>
<p>For example, after clicking the browser icon robot needs to wait until the browser will launch – in this example, in the command for opening a browser (left click on its icon) you should enter 5000 (5 seconds) in the «Pause» field.</p>
### Note
<p>The «Note» field allows you to write comments so you don’t get confused in the commands.</p>
## Fields that appear only with certain actions
### Coordinates or image
<p>When creating actions associated with a mouse click, you are asked to choose where to click - according to certain coordinates or by image. If a software you’re working with has a static interface, meaning the button locations don’t change, then you can use coordinates. Then the question comes up, “How to calculate coordinates?”. It’s really simple – when you press «TAB» you need to locate your cursor to the place you wanna click. The coordinates will be entered automatically to the dialog window.
<p>But if a software doesn’t have a static interface we highly recommend using the click on image feature.  To do that just click the «Image» switch in the dialog window. 
<H1 align="center">![Screenshot](img/clicker_5.png)</h1> 
<p>Depending on a switch selected the bottom part of the window will change –  the «Select image», «Highlight image» buttons and «Match rate» input field will appear. 
<p>The image that you need to click on to run the action can be configured in two ways:
<p>1) load an existing image by clicking the «Select image» button
<p>2) Use the «HIghlight image» button to select a fragment of the window snapshot. After clicking the button Studio will take a screenshot and will offer you to select a fragment of a resulting image.
<p>Keep in mind that if you use the “click on image” feature, that if there are multiple images on the screen the robot will apply the action to the first image found.
<p>The «Match rate» field is necessary for the cases, where the selected image slightly differs from the reality (for example, if on the image you highlighted the button in some way. but in reality the button is unhighlighted). In these kinds of cases you need to lower the match rate to the point when the robot will be able to find the image. But if you make the match rate really low, the robot might find the thing you weren’t looking for.
<p>Fields «Number of attempts» and «Pause between errors» are designed for when robot fails to find the image. You can specify how many times the robot should try to search for the desired image and how many seconds to wait between attempts. For example, after launching the browser, robot needs to press the «Plus» button to create a new tab. If browser launch time is gonna be longer than 5 seconds (this time is specified in the pause between actions field), then Studio will try to look for the «Plus», that’s not there yet. In that case the Studio will wait the number of seconds you specified between attempts and try again.  As soon as the image is found, the program will wait the number of seconds you specified in the «Pause» field of the command, and proceed to the next.
### Scrolling
<p>This field appears when the action «Scrolling» is applied. The amount of pixels you need to scroll down for is entered to the field. If you need to scroll up, the number of pixels should be positive, but if you need to scroll down, the number of pixels should be negative.
<p>The use of variables in all command creation dialog windows is possible.
## Description of all actions available in the module 
### Action «Click the mouse» 
The main purpose of this module is pressing the left or right mouse button. 
### Action «Double-click the mouse»
Double-clicks on the specified coordinates or image, for example, to open applications from the desktop.
### Action «Click the right mouse button»
Clicks the right mouse button, for example, to open a context menu.
### Action «Click the scroll wheel»
In some applications mouse wheel is used not only to scroll, but, for example to close the tabs. Action clicks the scroll wheel. 
### Action «Scrolling»
The action scrolls the page up or down. Since there might be multiple scrolling sliders on the screen you need to position your cursor to the one you need. To scroll down you need to put in a negative number of pixels in the «Scrolling» field (-150), to scroll up you need to put in a positive number (150).
### Action «Enter text»
<p>This action enters text that is written in the «Text» field. The field where the text is entered should be selected (there should be focus).
<p>Some applications require specific text input (in the specific encoding). In these cases you should pick one of the encoders from the “Use encoder” drop-down list or enter the name of the desired  encoder yourself. The text can be in a variable and be copied from any program that uses the specified encoding. In this case, when pasting copied text into another program, you must first scan it in the encoding of the original program. The encoding of the source program is entered or selected in the «Initial coding» field. Filling these fields is optional. 
<p>The «Use WinInput» checkbox allows you to enable more correct and faster text input, but it may not be supported by some applications. The use of this checkbox is optional.
<p>Example of filling in an action: 
<H1 align="center">![Screenshot](img/clicker_6.png)</h1> 
### Action «Press key»
Imitates the key presses of a keyboard. Choose the desired key in the «Key» drop-down list. All possible keys are available on the list, keys that might be present on some extended keyboards are present too (changing the volume, start/stop playback, etc.).
<H1 align="center">![Screenshot](img/clicker_7.png)</h1> 
### Action «Press two keys»
Imitates double key presses, for example CTRL+A – selection of all text in the field. All required keys are selected in the «Кнопка» drop-down list. The list is the same as in the «Press key» action.
<H1 align="center">![Screenshot](img/clicker_8.png)</h1> 
### Action «Copy»
Imitates the CTRL+C hotkey. It copies the selected value to the clipboard and inserts it, if necessary, to the variable specified in the «Write to» field. This field is optional.  Variables always start with the «@» symbol.
<H1 align="center">![Screenshot](img/clicker_9.png)</h1>
### Action «Paste»
Imitates the CTRL+V hotkey. Inserts the value from the clipboard into the selected field.

