Change tooltip display delay in Cocoa application
In most cases default tooltip delay of OS X (around 1000 ms) isn’t an issue, as in general you rarely would like to see tooltips all the time you move mouse around.
However while developing one application I had requirement to make tooltip appear faster than that, i.e. decrease tooltip display delay. Hopefully there is a way to do it in OS X.
Tooltip display delay is a property configurable through NSUserDefaults
mechanism. So to set it to 50 ms, you can do following:
defaults write -g NSInitialToolTipDelay -int 10000
However that would change preference for whole system, which isn’t something that is desired. But it isn’t a problem – you can set it just for single application:
defaults write com.appdomain.AppName NSInitialToolTipDelay -int 10000
com.appdomain.AppName
should be the bundle identifier of the application to change preference for. Of course you can also just automate it in your application:
// Alter tooltip delay setting
[[NSUserDefaults standardUserDefaults] setObject: [NSNumber numberWithInt: 50]
forKey: @"NSInitialToolTipDelay"];
That’s all, hopefully you find it useful.