- Nuget
- Documentation up to date with the most recent Nuget relase (0.1.8)
- Getting started
Install-Package MacroFramework
Setting up is simple. Use the MacroSetup.GetDefaultSetup()
as your template (or don't change it at all).
MacroSetup setup = MacroSetup.GetDefaultSetup();
setup.Settings.GeneralBindKey = KKey.CapsLock;
setup.Settings.CommandKey = KKey.LWin;
setup.Settings.MainLoopTimestep = 15;
setup.Settings.AllowKeyboardHook = true;
setup.Settings.AllowMouseHook = true;
The framework uses reflection to automatically parse classes you create in a given assembly definition. If you want to disable this feature, simply set setup.CommandAssembly = null;
.
This command will open Notepad when you press 'left control' and 'n' in order and release the keys.
using MacroFramework.Commands;
public class NotepadCommand : Command {
[BindActivator(KKey.LCtrl, KKey.N)]
private void OpenNotepad() {
System.Diagnostics.Process.Start("Notepad.exe");
}
}
If you disabled loading via reflection you need to activate the command manually using:
setup.CommandToUse = new HashSet<Type>();
setup.CommandsToUse.Add(typeof(NotepadCommand));
Start the Macro framework with your custom setup class as a paremeter.
public class Program {
[STAThread]
static void Main(string[] args) {
Macros.Start(MacroSetup.GetDefaultSetup());
}
}
You have now started the application with a single macro. Ctrl+N will open the notepad for you!
For more in depth guide read the Getting started guide. Check out the code examples for more more complex use cases.