How to use TGMacro









Macro Editor


tgmacro macro editor menu


  1. Add Action: Open Action Editor to add new action to action list such as keyboard action, mouse action. You learn more about action from Actions page.
  2. Edit Action: Open Action Editor to edit current new action to action. You learn more about action from Actions page.
  3. Duplicate Actions: Duplicated selected actions and add them end of the actions list.
  4. Remove Action: Removes selected actions.
  5. Adjust Timing: Open Wait Ajuster to add or subtract from all wait actions in the actions list.
  6. Add Action After: Open Action Editor to add new actions after each selected actions.
  7. Clear All Actions: Removes all actions from the action list.
  8. Move Actions UP: Moves selected actions to UP in the list.
  9. Move Actions DOWN: Moves selected actions to Down in the list.
  10. Import AMC Script: Imports AMC script such as recoil script and convert them into TGM actions and then them adds action list
  11. Triggering Area: Specifies when the actions triggered. By keyboard or mouse key or combinations or color changes on the screen. You learn more about triggers from Triggers page.
    • Trigger Action by : This is where you select which kind of events should trigger your macro.
      • Key Events : Select key events if you wan't your actions to trigger when sipecific mouse or keyboard key pressed.
      • Pixel Events : Select pixel events, If you want your actions to be triggered when they match or do not match the color you have chosen in the designated area on the screen.
    • When : This is where you select when your the event above should trigger.
      • Key Pressed : Trigger once the key pressed.
      • Key Hold : Triggers and repeat as long as key pressed and hold.
      • Key Toggle : Press once to trigger. Actions will repeat until you pressed again.
      • Color Matches : Selected color matches the color on the sepesified screen cordinats. To get cursor cordinates press CTRL + X. To get color on cursor position press CTRL + C
      • Color Matches : Selected color NOT matches the color on the sepesified screen cordinats. To get cursor cordinates press CTRL + X. To get color on cursor position press CTRL + C
    • Keys : This where you specify with which key or key combination your macro will be triggered. Mouse and keyboard keys can be combined like SHIFT + LeftMouse, SHIFT + LeftMouse etc
  12. Recording Settings Area:
    • Capture Mouse Position :
      • Move To Pos : If you select this option TGM will record exact position of cursor.
      • Add To Current Pos : If you select this option TGM will record the diffrent between cursor first and second position. Let's your cursor at position x:50 and y:10. If you move your cursor to x:10, y:20 TGM will record x:-40, y:10. This option can be used to create recoil macros.
    • Record Section:
      • Mouse Movements : You check this TGM includes cursor cordinates.
      • Mouse Buttons : You check this TGM includes Mouse Button clicks.
      • Keyboard Keys : You check this TGM includes Keyboard Key presses.
      • Delays : You check this TGM includes delay between key strokes and mouse movements.
  13. Test Button: Test your macro before saving.






Actions


What are actions?


Actions are the operations that make up your macro, such as mouse movements, keyboard keys, mouse buttons, delays, etc.
By combining these operations in the order you want, you can easily automate tasks and avoid doing repetitive work.

tgmacro action editor window mouse move action

Mouse Movement Action

Mouse movement actions only to move mouse. You can send clicks when you selected this action.

  1. Positioning:
    • Move to Pos: This option moves the mouse to spesified position.
    • Add to Current Pos: This option adds or subtracs spesified values from current mouse position. Positive value to add, Negative value to subtract
  2. Position: Show macro editor window to edit specific macro.


tgmacro action editor window mouse key event

Mouse Key Action

With mouse key action you can send mouse keys such as LeftMouse, RightMouse etc with or with moving the cursor.

  1. Positioning:
    • Move to Pos: This option moves the mouse to spesified position.
    • Add to Current Pos: This option adds or subtracs spesified values from current mouse position. Positive value to add, Negative value to subtract
  2. Position: Set position based on Selected Positioning Option
  3. Keys: Click to set mouse key to send.
  4. Key Status:
    • Press: Send key press and then release.
    • Down: Sends key press and hold until Up status sended.
    • Up: Sends key release status.






tgmacro action editor window keyboard key

Keyboard Key Action

With keyboard key action you send mouse key LeftMouse, RightMouse etc with or withmoving the cursor.

  1. Keys: Click to set mouse key to send.
  2. Key Status:
    • Press: Send key press and then release.
    • Down: Sends key press and hold until Up status sended.
    • Up: Sends key release status.




tgmacro action editor window wait action

Wait Action

You can use wait action to put delay between other actions

  1. Wait Amount: You can specifiy wait amount as milliseconds.




tgmacro action editor window text action

Text Action

With text action you can send sentences instead of single keystrokes.

  1. Text: Here you can specifiy text to send.






Triggers


What are triggers?


As the name suggests, triggers determine when macro operations are triggered.
With triggers, you can make your macro triggered by a specific key or key combination, or by a color change in a specific area of your screen.



tgmacro action editor key event

Key Events Trigger

With key events you can trigger your macro when specified keys pressed, hold or toggled.

  1. When:
    • Key Pressed : Trigger once the key pressed.
    • Key Hold : Triggers and repeait as long as key pressed and hold.
    • Key Toggle : Press once to trigger. Actions will repeat until you pressed again.
  2. Keys: This where you specify with which key or key combination your macro will be triggered. Mouse and keyboard keys can be combined like SHIFT + LeftMouse, SHIFT + LeftMouse etc.


tgmacro action editor pixel event

Pixel Events Trigger

Select pixel events, If you want your actions to be triggered when they match or do not match the color you have chosen in the designated area on the screen.

  1. When:
    • Color Matches : Select this if you want your event trigger when selected color and color on screen position matches.
    • Color Not Matches : Select this if you want your event trigger when selected color and color on screen position NOT matches.
  2. Color Position: Pixel x and y coordinates on the screen
  3. Color : Color to look for on specified position






Creating first macro


Let's start simple

Let's create a macro that send clicks to mouse current position.



tgmacro supporter edition

Lets start TGMacro

If you have any question about main screen, you can visit this page. If not, you can continue by click Add New Macro button.

This will open macro editor screen which we will use to create our macros.



tgmacro macro editor window

In Action Editor window we can do plenty of things.
Therefore might be confusing at first. If you have any question about this window you can visit this page

Let's start with setting triggers. You can learn more about triggers here.
Basically with trigger we will determine which key starts our macro and how long it gonna repeat.
I want my macro to repeat as long as I hold G button. To do this we set our Trigger action as Key events
Then When value as Key Hold this will tell TGMacro to repeat this macro as long as I hold the button I set for trigger.
Finally set the Keys value by click to text says Click here to set key. When we do it will start for listening for a key.
I'm gonna press G here. Because I want my macro to start with G key. After that we should be able to see our key on the text area previously says Click here to set key. If so we done setting our trigger.

Now we can add our actions so TGM can send them for us. To do so just click icon right next to action list to Add Action.
This is opens Action Editor window. You can learn about action from this page.





tgmacro action editor window mouse key

Action window should look like this. (Could be more or less options depending on action type selection)

Since I want to send a mouse key I select Mouse Key as Action Type then I select Add to current pos as Positioning
Add to current pos modifies Mouse current position, So it adds or subtracts from mouse current position.
But I don't want mouse to move by itself. I want it to send clicks wherever I move my mouse. So leave Position values as 0, 0.
Now time to set which mouse key it gonna send. We do exacly same here as we did for setting trigger key. But instead of pressing G we just LeftClick on the text area because we want it to send LeftClick
Now as a final step we choose Key Status but since we don't want mouse to hold or something we leave it as Press and click Save

This will take us back to Macro Editor window but we already set everything here except givin a name to our macro. Lets do that click Save.



tgmacro creating first macro main window

We should end up a screen like this.

Now all we need to do this pressing Enable {Home} button or Home key (if you haven't changed) on your keyboard to active software.

Ok!. Now we should be able to test our macro. Let's press and hold G button on your keyboard and see if everything works fine.

For better testing you can search CPS TEST on GOOGLE or just click here.
You can pick any CPS TEST website from result to test your macro.



Check out other projects

CSInputs

2021
CSInputs is a C# library that enables developers to send and read mouse and keyboard inputs in WinForms, WPF and Console Applications. It allows users to interact with applications even when their window is inactive.