How-to: Keyboards

How do I create macros?


Macros are sequences of actions (such as keystrokes, mouse clicks, and delays) that can be played back to help with repetitive tasks. They can also be used to replay sequences that are long or difficult to run. You can assign a macro recorded in Microsoft Mouse and Keyboard Centre to a key or a mouse button. You can also use the Macro Repeat feature to play and repeat a macro continuously, and then stop it at any time.

Notes:

Macro Repeat does not support switching applications. For example, if you open your Web browser while a macro is repeating in a game, the macro stops repeating. Likewise, if you include a command in a macro to switch to a different application, Macro Repeat does not take effect, and the macro runs once only.


  • If you press a key assigned to start a repeating macro and then press a key assigned to a different macro, the repeating macro stops.
  • A repeating macro does not include a time delay at the end of a sequence. You can add a delay in the Editor box if you want.

Microsoft Mouse and Keyboard Centre macros use a .mhm extension and are saved as individual files in your default Documents\Microsoft Hardware\Macros subfolder. Macros recorded in keyboard and mouse are interchangeable. You can run them or edit them from either program.


Caution - Do not save passwords or other sensitive information in macros.


  1. Using the keyboard that you want to configure, start Microsoft Mouse and Keyboard Centre.
  2. Select a key in the Key Settings List.
  3. In the list under the key that you want to reassign, select Macro.
  4. Click Create a new Macro.
    An empty macro is created and added to the macro list.
  5. In the Name box, type the name of the new macro.
  6. Click in Editor, enter your macro.
    You can record events such as keystrokes, mouse clicks, and delays between actions. You cannot capture mouse movement or actions performed through macros assigned to reassignable keys.
  7. In the Available Macros list, make sure that the new macro is selected.

To record two or more events at the same time


  1. Enter the first event (for example: press the SHIFT key).
  2. Right-click the selected event and then select Split. The event will split into three separate events: a button press-and-hold, a time delay, and a button release.
  3. Click between the two separate events (either before or after the delay).
  4. Enter the second event (for example: Mouse Button 1).

To edit an existing macro


  1. Using the keyboard that you want to configure, start Microsoft Mouse and Keyboard Centre.
  2. Select a key in the Key Settings List.
  3. From the Available Macros list, select the macro you want to edit.
  4. Click in Editor and edit the macro or enter new events.

To enable Macro Repeat (play a macro repeatedly)


  1. In the Macro Editor, select a macro from the Available Macros list
  2. Click Edit Macro icon
  3. Turn on the Repeat

To play a macro


  • Press the key assigned to the macro.

To cancel a macro during playback


  • Press the key assigned to the macro again, or start another macro.

To toggle a repeating macro


  1. After you enable Macro Repeat for a macro, press the key assigned to the macro to start it.
  2. Press the key again to stop the macro from repeating.
    Or, to stop the repeating macro and start another macro, press the key assigned to the other macro.

To use press and hold for a repeating macro


  1. After you enable Macro Repeat for a macro, press and hold the key assigned to the macro to start it.
    A sound indicator plays to inform you that you are using Macro Repeat.

Release the key to stop the macro from repeating.