Just a simple patch using MouseKeyHook to retrieve KeyKodes and and Mouse Position.
Edit: See @Elias explanation and patch here: