You can add it under System Preferences -> Accounts -> Login Items.
I also just made another crude executable that doesn't even require you to click the fix mouse button. Turns out it opens in a Terminal window though, but see which you prefer. Edit
s: heh, you can just put it in a simplistic app bundle. Create a folder, put the program in there, then rename the folder to the same name as the executable with .app added (e.g. decelerate_mouse.app containing decelerate_mouse), and bingo. It doesn't appear to do anything, but it does work.
Code: Select all
#include <stdio.h>
#include <string.h>
#include <IOKit/hidsystem/IOHIDLib.h>
#include <IOKit/hidsystem/IOHIDParameter.h>
#include <IOKit/hidsystem/event_status_driver.h>
int main(int argc, char **argv)
{
const int32_t accel = -0x10000;
io_connect_t handle = NXOpenEventStatus();
const char *name = strrchr(argv[0], '/');
if (name)
++name; // one past the last slash
else
name = argv[0]; // no slashes, just eat it whole
if (!handle) {
fprintf(stderr, "NXOpenEventStatus is uncooperative\n");
} else {
kern_return_t ret;
if (strcasestr(name, "mouse")) {
ret = IOHIDSetParameter(handle, CFSTR(kIOHIDMouseAccelerationType), &accel, sizeof accel);
if (ret != KERN_SUCCESS)
fprintf(stderr, "Error fixing mouse: %d\n", (int)ret);
}
if (strcasestr(name, "trackpad")) {
ret = IOHIDSetParameter(handle, CFSTR(kIOHIDTrackpadAccelerationType), &accel, sizeof accel);
if (ret != KERN_SUCCESS)
fprintf(stderr, "Error fixing trackpad: %d\n", (int)ret);
}
NXCloseEventStatus(handle);
}
return 0;
}
Leave "mouse" or "trackpad" in its name to have it fix the mouse or trackpad. I.e. if you like your trackpad
with accel, remove trackpad from its name. Really crude form of parameter passing because the login item thing won't let you.
You can double-click it if you feel the need.