A macro is a shortened version of a computer command which makes the computer carry out a set of actions. The main function of macro: multiple events can be triggered through one key. Macros can be used for one-key combos, one-key chat, etc. It is very useful in some clicks that require repeated clicks or fixed logic. This article will tell you how to set up the macro, the specific syntax and usage of the macro, and some common macro examples. 

 

 

1. How to set up the macro



Step 1: First, you need to download LDPlayer and a game, and start the game in the emulator.

Step 2: Click the "Keyboard mapping" in the upper right corner of the emulator, find the button "Write macro", and drag that button into the game interface (The position of the button is arbitrary).

 

Introduction to Keyboard macroIntroduction to Keyboard macro

 

Step 3: Click the pencil button in the lower right corner of the button that you dragged, click "Save" after writing the command (For details, please refer to the second and third sections of this article). After setting a macro, click the "Save" buttons in the lower right corner of the "Macro editor" and the emulator respectively.

Introduction to Keyboard macro

 

Note: The way to get the coordinates: when you hover your cursor over one position in LDPlayer, the coordinate of that position will be showed in the bottom left corner of "Macro editor" automatically. (Only version 3.24 or higher has this function) 

Introduction to Keyboard macro 


 

2. The specific syntax and usage of the macro



1. Size command

Command name: size 

Syntax format: size x1 y1

Example: size 1280 720

Usage: the resolution of the current emulator window. The size command can still be triggered after zooming in or out on the emulator window. The size command must be added before the macro command that needs to use the coordinate, and it will be invalid after the emulator resolution is changed. If you want your size command to take effect again, your size command needs to be reconfigured or the emulator resolution is changed back.

 

2. Touch command

Command name: touch

Syntax format: touch x1 y1 time (ms)

Example: touch 200 200 1000

Usage: Click on the specified position on the emulator window.

 

Command name: touch 

Syntax format: touch x1 y1 x2 y2 time (ms)

Example: touch 100 200 200 200 1000

Usage: simulate the sliding operation of the mouse, sliding from dot A to dot B, you can also set the time required for sliding.

 

3. Wait command

Command name: wait 

Syntax format: wait time (ms)

Example: touch 500 500

                wait 1000

                key A

Usage: It can be used with click commands such as touch command and key command to wait for a delay. The time unit is millisecond.

 

4. Press command

Command name: press

Syntax format: press x1 y1 x2 y2 time (ms)

Example: press 200 200 200 300 5000

                release

Usage: Long press the positions of coordinates, the long press time of each coordinate is determined by the time that is set, such as the time 5000ms in the above example, the long press time of each coordinate will be 2500ms. The long press command needs to be combined with the release command.

 

Press-n (n=1,2,3,4,5...) command

Command name: press-n

Syntax format: press-n x1 y1

Example: press-1 200 200

                press-2 200 300

                press-3 300 400

Usage: Click on n positions at the same time. The above example shows that three positions will be clicked simultaneously. The release command is not required in this press-n command.

 

5. Key command

Command name: key

Syntax format: key 

Example: key A

Usage: The preset key mappings can be triggered by the key command, that is, one-key combos can be realized by the key command.

 

6. Text command

Command name: text

Syntax format: text

Example: key enter

                text Guys! Quickly use LDPlayer to play Arena of Valor!

Usage: key command will trigger the Enter key to open the chat window first, and then text command will copy the words that you have set previously to the chat text-input box. 

 

7. Ondown, Onup command

Command name: ondown

                             onup

Syntax format: ondown

                        onup

Example: ondown

                touch 100 100

                onup

                touch 200 100

Usage: the coordinate (100,100) will be clicked when a macro key (A key that you must input by pressing it on your keyboard as soon as you drag the "Write macro" into the game interface) is pressed, the coordinate (200,100) will be clicked when that macro key is released.

 

8. Loop command

Command name: loop

Syntax format: loop

Example: loop

                touch 100 100

Usage: Press and hold the macro key to start the loop, release the macro key to stop the loop. The loop in the above example is "touch 100 100". So the coordinate (100,100) will be touched constantly as long as you hold the macro key all the time. Moreover, the coordinate (100,100) will not be touched after you release the macro key. If you want your loop to be kept even after you release the macro key, you can use the mouse to click on other computer applications or your computer desktop while holding the macro key.

 

9. Switch-mouse command

Command name: switch-mouse

Syntax format: switch-mouse

Example: switch-mouse

Usage: Used to control the view after hiding the mouse. It needs to be used with the Shoot-view button to take effect.

 

10. Type=mouse-lock command

Command name: type=mouse-lock 

Syntax format: type=mouse-lock

Example: type=mouse-lock

Usage: Used to fix the mouse in the emulator window to prevent it from moving outside the emulator. It can be used in MOBA games to prevent the mouse from disappearing during observation.

 

11. Type=cancel command

Command name: type=cancel

Syntax format: type=cancel

Example: type=cancel

Usage: Press the macro key while holding the skill key to cancel the cast.

 

3. Some common macro examples



1. Press F (any key can be set) to trigger 3 clicks, whose coordinates are as follows respectively, (800, 600), (900, 600), (1000, 600).

Introduction to Keyboard macro 

 

2. When you press F, the dot (800, 600) will be clicked automatically. When you release F, the dot (900, 600) will be clicked automatically.

Introduction to Keyboard macro 

 

3. Slide.

Introduction to Keyboard macro 

 

4. Loop command: Long press F to execute click events.

Introduction to Keyboard macro 

 

5. Long press.

Introduction to Keyboard macro 

 

6. Key command: Call the key that you have set. It will be easier to implement the combo. When you press 6, the skills of E and W will be released respectively and the direction of these skills follows your mouse. 

Introduction to Keyboard macro 

 

7. text command: Chat with others through one key in Arena of Valor. Trigger the Enter key to open the chat window using key command first, and then copy the words that you have set previously to the chat text-input box via text command. 

Introduction to Keyboard macro 

 

8. Switch-mouse command: Show or hide the cursor in games like PUBG MOBILE. View the picture 1 below. Besides, please note that you need to drag the Shoot-view to LDPlayer if there is no keyboard mapping for it. For example, now there is no keyboard mapping for Rules of Survival, so you need to drag it first, as shown in picture 2 below. 

Introduction to Keyboard macro 

Introduction to Keyboard macro 
 

In 3D games, it can be used to hold the right mouse button to change your view, and your cursor will be shown after you release the right mouse button, as shown below. 

Introduction to Keyboard macro 


size 1920 1080 
ondown 
switch-mouse 
onup 
switch-mouse 

9. Mouse-lock command: It is used to lock your mouse and so your cursor won’t be moved outside LDPlayer. 

Introduction to Keyboard macro 

 

10. Click multiple dots. (Only available for the version 3.55 or later)

size 1280 720
press-1 855 487 #open/close doors
press-2 823 275 #pick up the first item
press-3 1155 322 #exit vehicles
press-4 640 440 #revive
Introduction to Keyboard macro 

 

Many other macro combos can come true as long as you are imaginative about our Macro feature.