Easy Macros is a free software allowing to easily define macros for your games and applications, without the need of acquiring sophisticated gaming hardware.
This portable software runs in background, located in the notification area of the taskbar:
A built-in GUI allows managing macros:
Easy Macros globally captures user input using the UserActivityMonitor DLL by George Mamaladze. When a macro is triggered, user activity is simulated using the Windows API, most notably with keybd_event and mouse_event functions.
See User Manual to learn how to create a macro.
Easy Macros is provided under CDDL-1.0 (Why?).
Basically, you can use it or its source for any project, free or commercial, but if you improve it or fix issues, the license requires you to contribute back by submitting a pull request with your improved version of the code. Also, credit must be given to the original project, and license notices may not be removed from the code.