In an app I'm developing, a database is used to store all user data, usually located somewhere in Library/Application Support. In order to enable the user to switch the database, I want to implement a functionality similar to iTunes or iPhoto, where the app asks for the library's or database's location if the option key is pressed upon starting the app.
How can I check the currently pressed (modifier) keys if no NSEvent is at hand?
I already tried:
[NSResponder flagsChanged:(NSEvent *)theEvent]
– Probably not called because the option key is already down before the window and any responders are instantiated.
[[NSApplication sharedApplication] currentEvent]
– Returns nil
.