How to Create a Macro for Mouse Clicks and Keystrokes: Step-by-Step Guide 2026

NewSoftwares.net editorial teamPublished November 2026Last verified: November 202614 min read

A macro for mouse clicks and keystrokes is a saved sequence of key presses, typed text and pointer clicks that Windows replays from one trigger. This guide covers Windows 10 and 11 and shows which free tool records which half of the job.

The short version: no single free tool handles every step type well, so match the tool to the step.

See our top recommendation

Quick answer

Open Power Automate for desktop, select Record, perform the clicks and keystrokes once, then save the flow and run it. Typed text and app launches are faster in a hotkey or text-macro tool. Add a short wait after every click that opens a window.

A macro sequence from one key combination1234ClickTypeWaitLaunchCtrlAltM= one triggerinvoice 2041Send keys · Click 640, 380 · Sleep 300 ms · Run app

At a glance

Applies to
Windows 10 and 11
Time needed
15 minutes for a simple macro
Difficulty
Beginner to intermediate
Cost
Free options covered
Admin or internet
Sign-in for one tool, no admin for most
Last verified
November 2026

What one macro can send to Windows

  • Typed textsnippets and boilerplate
  • Key pressesshortcuts and sequences
  • Mouse clickspositions and buttons
  • Program launchesapps, folders, sites

How to Create a Macro for Mouse Clicks and Keystrokes: Quick Answer

To create a macro for mouse clicks and keystrokes on Windows, record the steps once in Power Automate for desktop, or script them in AutoHotkey, then assign a trigger and test with short waits. Typed text and app launches need no recorder at all.

Windows has no built-in macro recorder on the desktop. What it has is a set of free tools that each cover part of the job, which is why the sections below sort them by the step types they handle. Power Automate for desktop records mouse and keyboard activity and turns it into editable actions. AutoHotkey lets you write the same sequence as a short script. PowerToys Keyboard Manager remaps keys and shortcuts, and can insert text, start a program or open a web address from one shortcut.

This guide is for people who repeat the same clicks and typing on a Windows PC and want to stop. It assumes no scripting background. If you only retype the same text, jump to the typed-shortcut tutorial. If a macro already runs but misses, go straight to the fixes.

Pick your path

Choose what you need help with. The links jump to the section that owns the answer.

Macro type picker

What do you repeat most often? Select one to see the matching route.

Use a recorder. Power Automate for desktop records clicks against the controls you touch. Read recording your first macro and keep the display scale unchanged between recording and running.

What Keyboard Macros Can Automate

Windows macros fall into four types: typed text, key sequences, mouse clicks and program launches. Each needs a different tool feature, and only recorders and scripts reproduce mouse clicks, which is why the mix matters before you pick software.

Macro types and the tools that handle them
TypeWhat it sendsExampleTools that do itNeeds click positions
Typed textCharacters you would otherwise typeA signature, an address, a case referenceAny text-macro tool, AutoHotkey, PowerToysNo
Key sequenceShortcuts and special keys in orderCtrl+S, Tab, Tab, EnterAutoHotkey, PowerToys, recordersNo
Mouse clicksClicks at a position or on a controlOpen a menu, tick a boxRecorders and AutoHotkeyYes
Program launchStarts an app, folder or web addressOpen the morning reportsPowerToys, AutoHotkey, hotkey launchersNo

What you need before starting

  • A PC running Windows 10 or 11. Windows 10 reached end of support on October 14, 2025, but the tools in this guide still run on it.
  • The task written as plain steps, with the exact window and menu names you touch.
  • An app layout that stays the same: same window size, same display scale, same monitor.
  • Ten to fifteen minutes and a safe test file, never live data.
Windows compatibility note

Windows Home can author and run Power Automate for desktop flows on the local PC, but cannot trigger them from the cloud. A macro tool running with normal rights cannot send input to an app that runs as administrator, so run both at the same level if one macro must reach the other.

Anatomy of a macroTriggerClickSearch boxSendinvoice 2041Wait300 msSendEnterWhere each part livesTrigger = hotkey, typed prefix or button | Steps = what the tool replays | Waits = your safety margin
Anatomy of a macro: one trigger, then click, send, wait and send again.

The Send-Click-Wait rule

  1. Write every step as Send, Click or Wait.
  2. Anchor each Click to a window position or a control, never to a bare screen spot.
  3. Put a Wait after every step that opens or loads something.
  4. Run the macro three times on dummy data before you trust it.
Send, click and wait stepsSENDKeys, shortcuts, textCLICKPointer position and buttonWAITPauses until the app is readyEvery macro is a chain of these three step types
Every macro is a chain of Send, Click and Wait steps.

Best Free Methods to Create a Macro for Mouse Clicks and Keystrokes

Four free routes cover almost every case: remapping shortcuts with PowerToys, recording with Power Automate for desktop, scripting with AutoHotkey, and a dedicated text and key macro tool. Only the recorder and the script reproduce mouse clicks.

Remap or launch

PowerToys Keyboard Manager

Maps one key or shortcut to another, to a text sequence, to a program or to a web address. It does not record clicks.

Record and replay

Power Automate for desktop

Records mouse and keyboard activity into editable actions. The only free route here that captures clicks without code.

Script

AutoHotkey

Write Send, Click and Sleep lines in a short script file. Exact control, with a learning curve.

Typed shortcuts

Text-macro tools

Replace a short typed trigger with a block of text or keystrokes. Fast for typing, silent on clicks.

Remap and launch with PowerToys Keyboard Manager

Microsoft’s Keyboard Manager, part of the free PowerToys suite, swaps one key or shortcut for another and can send a fixed text sequence. Recent versions also map a shortcut to a program path or a web address, and a mapping can be limited to one app. Because it only understands keys, it never learns where to click. Keep PowerToys running at startup or the mappings stop applying after a restart.

Record and replay with Power Automate for desktop

Power Automate for desktop ships with Windows 11 and installs on Windows 10 from Microsoft’s site or the Store. Its recorder watches mouse and keyboard activity and ties each action to the window control you touched, then lists the result as editable steps. You sign in with a Microsoft account to use it. The Windows Home edition can author and run flows locally.

Works well for

  • Clicking through the same screens in a desktop app
  • Editing a step without re-recording everything
  • Controls that move a little between runs

Falls short on

  • Some Start menu and system tray steps are not captured
  • Keystrokes into a maximized Remote Desktop window
  • Anything that needs a quick one-line hotkey

Script with AutoHotkey

AutoHotkey version 2 sends keystrokes with Send, clicks with Click and pauses with Sleep. SendInput is the default send mode and is generally the most reliable. Click positions are read relative to the active window unless you change CoordMode, which is the setting to check first when clicks drift. The AutoHotkey documentation warns that not every game accepts sent keys and clicks.

Use a dedicated text and key macro tool

This category stores a short trigger and the text or keystrokes it should type, and some add multiple clipboards and a hotkey launcher. It is the least effort for repeated typing. It will not click a button for you unless the tool says it records clicks, so read the feature list before you count on that.

Step-by-Step: Create a Macro for Mouse Clicks and Keystrokes

Plan the steps, record or write them, assign one trigger, then test and add waits. A simple macro takes about fifteen minutes, and the test step is where most macros get fixed.

  1. Write the sequence on paper

    List each step as Send, Click or Wait. Keep a macro under about fifteen steps, because Microsoft’s own macro guidance for Excel recommends several short macros over one long one. Note the window size and display scale you use.

  2. Record or define it

    In Power Automate for desktop, press Record and act at a calm pace. Microsoft’s training module advises going slowly and waiting several seconds between actions. In AutoHotkey or a text-macro tool, type the steps instead.

  3. Assign one trigger

    Pick a key combination no installed program already uses, such as Ctrl+Alt plus a number, or a typed prefix like a slash before a short code. Avoid single letters.

  4. Test, then add waits

    Run it three times on dummy data. Wherever a window or page needs time to load, add a Wait step. Check the result with the steps in the verification section.

Recording Your First Macro

Power Automate for desktop records clicks and keystrokes against the controls you touch, so a recording survives small window shifts better than raw screen coordinates do. Install it, press Record, do the task once at a calm pace, then save.

  1. Open Power Automate from the Start menu. It is preinstalled on Windows 11. On Windows 10, install it from Microsoft’s site or the Microsoft Store, then sign in with a Microsoft account.
  2. Create a new desktop flow and select Recorder in the flow designer toolbar.
  3. Select Record in the recorder window, then perform the task once. Pause for a couple of seconds between actions.
  4. End the recording from the recorder window and read the generated actions. Delete any step that captured a slip.
  5. Save the flow and run it on a test file. If a step races ahead of a slow screen, add a wait action before it.
Known limits

Microsoft lists two recorder gaps: steps from the Windows Start menu or system tray may not be captured, and keystrokes sent to a maximized Remote Desktop window through an image-based recording are not recorded. Open the app with a launch action instead of recording the Start menu.

Assigning Macros to Specific Keys

A macro trigger should be a key combination that no installed program already uses, such as Ctrl+Alt plus a letter, or a prefix you type before a short code. Single letters and shared shortcuts such as Ctrl+C will collide with the app you are in.

There are three common ways to bind a trigger. In PowerToys Keyboard Manager you choose the shortcut, pick an action such as Run program, Open URL or send Text, and optionally name the app it applies to. In AutoHotkey the hotkey is the text before the double colon: ^!d:: means Ctrl+Alt+D. In a text-macro tool you type a short prefix and code, and the tool swaps in the stored text.

Hotkey conflict checker

Tick each item as you confirm it.

0 of 5 completed

Four sample macros to copy

The scripts below use AutoHotkey version 2 syntax. Save each as a plain text file ending in .ahk, then double-click it. Change the positions and names to fit your own window.

Typed text with AutoHotkey 2 (type /sig then a space)
#Requires AutoHotkey v2.0
::/sig::Kind regards,{Enter}The Accounts Team
Insert today’s date with Ctrl+Alt+D
#Requires AutoHotkey v2.0
^!d::Send FormatTime(, "yyyy-MM-dd")
Click, type, wait and double-click with Ctrl+Alt+1
#Requires AutoHotkey v2.0
CoordMode "Mouse", "Window"   ; positions measured from the window’s top-left corner
^!1:: {
    Click 220, 140            ; focus the search box
    Sleep 300                 ; give the box time to take focus
    Send "invoice 2041{Enter}"
    Sleep 800                 ; wait for results to load
    Click "640 380 2"         ; double-click the first result
}
Open a folder with Ctrl+Alt+R
#Requires AutoHotkey v2.0
^!r::Run "explorer.exe C:\Reports"

Hotstrings fire when you type the trigger and then a space, a period, Enter or one of the other default ending characters. {Enter} inside the replacement sends a real Enter key press by default, so check the line before you run it on a form.

Fixing Macros That Misfire

Most misfires come from timing, window position or rights levels, not from the recording itself. Start with the table, work down the checklist, and re-test after each single change so you know which one fixed it.

Problem, cause and fix
ProblemLikely causeFix
Clicks land in the wrong placeThe window moved, the display scale changed or the app opened on another monitorMeasure clicks from the window with CoordMode, or record against controls. Full walkthrough: fix a macro that clicks in the wrong place.
Keys appear in the wrong fieldFocus had not arrived when the macro typedClick the field first, then add a short wait before sending text.
Nothing happens in one appThat app runs as administrator and the macro tool does notStart the macro tool at the same rights level, or run the app normally.
The trigger opens the wrong thingAnother program already uses that key combinationChange the combination and use the conflict checker above.
The macro works at home, fails at workDifferent display scale, monitor layout or app versionRe-record or re-measure on the work PC, and check the IT policy first.
The recorder skipped a menu stepStart menu and system tray steps may not be capturedReplace that step with a launch action for the app.
A game ignores the macroNot every game accepts sent keys and clicksRead the game’s rules on automation before trying another mode.

Misfire checklist

Work down the list before you re-record.

0 of 5 completed

Where to place a wait stepClickApp busyWindow readyTypeyour wait goes hereWithout a wait, the keys arrive before the window is readyAdd the pause where the app is busy, not after every step
Place the wait where the app is busy, not after every step.

Common Mistakes When You Create a Macro for Mouse Clicks and Keystrokes

The usual errors are recording too fast, trusting screen coordinates, skipping waits and testing on live data. Each one is cheap to avoid if you know it exists before you start.

Common mistake

Recording at full speed. A recording made without pauses replays faster than the app can respond. Slow down while you record and add waits afterwards.

Common mistake

Trusting a bare screen position. A coordinate that is right today is wrong after a window move or a display scale change. Measure from the window or use a control-based recorder.

Common mistake

Typing passwords into a macro. A stored password sits in plain view of anyone who opens the macro list. Let a password manager fill credentials instead.

Common mistake

Testing on live records. A misfire can delete, send or overwrite real data. Always rehearse on a copy.

How to Verify It Worked After You Create a Macro for Mouse Clicks and Keystrokes

A macro has worked when it produces the same result three times in a row on test data, in every app where you plan to use it, and after a restart. Check the output, not just the absence of errors.

  1. Run the macro on a copy of your data and compare the result with a manual run.
  2. Repeat the run three times. A macro that works twice and fails once has a timing gap.
  3. Restart the PC, then trigger the macro again to confirm the tool starts with Windows.
  4. Change the window size slightly and re-run if you rely on click positions.
  5. Write the trigger and purpose in your macro log so you can find it next month.

Mouse and Keystroke Macro Methods Side by Side

Only Power Automate for desktop and AutoHotkey reproduce mouse clicks. Text-macro tools and PowerToys cover typing, shortcuts and launches with far less setup, so most people end up using one of each rather than a single tool for everything.

Four free routes compared by what each can send
MethodMouse clicksKey sequencesLaunch appsCostBest for
PowerToys Keyboard ManagerNoYesYes (program or web address)FreeRemapping and one-key launches
Power Automate for desktopYesYesYesFree tier with a Microsoft sign-inRecording multi-screen tasks
AutoHotkey v2Yes (scripted)YesYesFree, open sourceExact control and hotstrings
Text-macro tool (such as Macro Keys)Not listedYes, via a virtual keyboardHotkey launcherFree downloadRepeated typing and clipboards

How to choose

Count how many of your steps need a click. If none do, skip the recorder: a text-macro tool or PowerToys is quicker to set up and easier to keep working. If most do, record once, then script the waits. If you run into an app that blocks sent input, no tool on this page will fix that, and a policy check comes first.

Setup effort rises left to right in the table above: a text macro takes about two minutes, a recorded flow about fifteen, and a script about an evening the first time you write one.

Choosing between hotkey, text expander and macroWhat repeats?One shortcutHotkeySame textText expanderClicks and keysMacroPick by what repeats, not by the tool you already have
A short decision path from task type to tool.

Situations Where a Macro Pays Off

A macro pays off when you repeat a task at least a few times a week, the steps never change and a mistake costs little. Data entry, canned replies and start-of-day routines fit. One-off jobs and screens that change daily do not.

Repeated form entry

Re-keying a form

Open the same intake form each morning, type the same headings, tab through the same fields. A recorded flow plus a typed shortcut covers it.

Typing the same text,addr

Repeating a reply

Support replies, meeting links and addresses are typed hundreds of times a year. A short typed trigger removes that work.

Launching apps with one keyF8

Starting the day

Open the same four apps, one folder and two web addresses with one shortcut instead of a dozen clicks.

A keypad for macrosF13F14F15F16F17F18F19F20F21

Spare keys, spare job

Extra keys on a second keyboard can hold the macros you use most, one key per task.

A quick payback estimate

Enter how often you repeat the task and how long it takes by hand and with a macro. The result shows the minutes you would save in a week.

Time saved calculator

Defaults are placeholders. Replace them with your own numbers.

The Tool We Recommend for Typed Shortcuts and Key Macros

If your repeated work is typing, shortcuts and launching apps rather than clicking, we recommend Macro Keys from NewSoftwares.net. It is a free Windows download that stores text and keystroke macros, keeps several clipboards and launches programs from a hotkey.

Where Macro Keys fits, and where it does not

Macro Keys is made by NewSoftwares.net, the publisher of this guide, so weigh this section with that in mind. Its feature list covers text macros, multiple clipboards, a hotkey launcher and macro encryption. It does not list mouse click recording, so for clicks use the recorder or script routes above.

Good fit if you
  • Type the same text or keystroke runs often
  • Want several clipboard slots instead of one
  • Prefer a small tool over learning a script language
Look elsewhere if you
  • Need a recorder that clicks buttons for you
  • Run macros on a Mac or Linux PC
Macro Keys main window listing three saved macros with their triggers and replacement text
Macro Keys: saved macros listed with trigger and text

Typed-Shortcut Tutorial: Build Your First Text and Key Macro

To build a typed shortcut, choose a trigger, enter the text to send, add any special keys with the virtual keyboard, then save and test it in a plain text window. The whole job takes about two minutes and needs no recording.

  1. Install Macro Keys from the NewSoftwares.net page and open it. The main window has three tabs: Macro Shortcuts, Multiple Clipboards and Hotkey Launcher.
  2. On Macro Shortcuts, choose Add Macro. A window titled Type Macro and Text to Send opens.
  3. Enter a short trigger in the Macro field. Start it with a comma or slash so it never matches a real word.
  4. Type or paste the replacement into Text to Send. For keys such as Tab, Enter, Date or Time, click the matching button on the virtual keyboard and it is added at the cursor.
  5. Choose Ok, open Notepad and type the trigger. The stored text should appear.

The Hotkey Launcher tab does the app-launching half of the job, and Multiple Clipboards keeps recent copies so you can paste an earlier one.

Macro Keys Type Macro and Text to Send window with a trigger field, text box and virtual keyboard buttons
The Type Macro and Text to Send window with its virtual keyboard.
Macro Keys Multiple Clipboards tab
Multiple clipboards hold several copied items at once.
Macro Keys options screen
The options screen controls startup and trigger behavior.
Tip

Windows also keeps a clipboard history of up to 25 items. Turn it on with Windows key plus V if you only need to paste recent copies.

Backing Up and Sharing Your Macros

Export your macros to a file after every meaningful change and keep that file somewhere other than the PC that runs them. A macro library you cannot restore is a library you will rebuild by hand after the next reinstall.

Macro Keys has Import Macros from File and Export Macros to File buttons in its macro window, so a backup is one click and a restore is one click. AutoHotkey scripts and PowerToys settings are plain files you can copy the same way. Power Automate for desktop flows are saved to your account and can be exported or copied from the flow list.

  1. Export or copy your macros after each change.
  2. Name the file with the date, such as macros-2026-11.
  3. Store a copy on a second drive or in cloud storage you trust.
  4. Test a restore on a spare PC once a year.
Before you share

Remove names, addresses, account codes and any password from a macro before you pass the file to a colleague. A shared macro runs with the permissions of whoever opens it.

Backing up macrosMacro listExport fileSafe copyExport, store a second copy, then test an import on the new setup
One export, two places: local copy and off-device copy.

Macros at Work

Before you automate on a work PC, check policy with IT, keep sensitive data out of the macro and log what each macro does. Most problems at work come from unapproved input automation, not from the macro itself.

Question 1

Does my employer allow macros?

Many do for ordinary typing and shortcuts, but policies differ. Ask IT before you run any input automation on a managed PC.

Question 2

What stays out of a macro?

Passwords, customer data, card numbers and anything covered by a compliance rule.

Question 3

Who is responsible for a mistake?

You are. A macro repeats an error as quickly as it repeats a correct step.

Question 4

Where do I get help?

The page on macros at work and IT policy covers questions to ask and a simple risk scorecard.

Read the full checklist on macros at work and IT policy.

Frequently Asked Questions

These are the questions readers ask most about macros for mouse clicks and keystrokes on Windows. Filter by topic, or open any question to read the short answer.

Can Windows record mouse clicks and keystrokes without installing anything?

Not on the desktop. Windows has no built-in macro recorder, but Power Automate for desktop is a free Microsoft app that records clicks and keystrokes. On Windows 11 it is preinstalled, and on Windows 10 you install it first.

Is it safe to use a macro on a work computer?

It is safe only if your employer allows it. Ask IT first, keep passwords and customer data out of the macro, and run it on test data before real work.

Why does my macro click the wrong spot?

The window moved, the display scale changed or the app opened on another monitor. Measure clicks from the window instead of the screen, and keep scale and layout the same as when you built it.

What is the difference between a macro and a hotkey?

A hotkey is the trigger, and a macro is the sequence the trigger plays. One hotkey can start a macro of many steps. The full comparison is on its own page.

Why does my macro work in one app and not another?

The second app may run as administrator while the macro tool does not, or it may block sent input. Run both at the same rights level, and check whether the app forbids automation.

Can a macro type a password for me?

It can, but you should not store one in a macro. Anyone who opens the macro list can read it. Use a password manager to fill credentials.

How many steps should one macro have?

Keep each macro to about fifteen steps. Several short macros are easier to test and repair than one long one.

Do I need to know how to code?

No. A recorder and a text-macro tool need no code. AutoHotkey needs a few lines of script, and the sample macros in this guide can be copied as they are.

Can a second keyboard run my macros?

Yes, with extra software that treats the second keyboard separately. The page on using a second keyboard as a macro pad explains the options and limits.

Go Deeper

About this guide. Written by the NewSoftwares.net editorial team and checked against Microsoft and AutoHotkey documentation in November 2026. NewSoftwares.net publishes Macro Keys, which this guide recommends for typed shortcuts only.

Stop retyping the same things

Start with one task you repeat every day, build a typed shortcut for it and measure the minutes saved by Friday.