views:

87

answers:

2

Is there a way to find out if the user is in the Exposé mode? (i.e., all windows are being shown.) Thank you.

+1  A: 

There's no public API for getting this information. What problem are you trying to solve?

Joshua Nozzi
I am creating a program that emulates a multi-touch trackpad. If you swipe four fingers up in the normal state, it's just like you press fn+F11 keys. If you are in the Exposé state, it's like you press the Escape key. So, I want to know if the user is in the Exposé state at a given moment or not. Thanks for your help anyway.
teezan
A: 

You don't need this information. If the user is not in Exposé, F11 (or fn-F11) will enter Exposé. If the user is already in Exposé, F11 (or fn-F11) will exit Exposé. So just send F11 (or fn-F11) unconditionally.

The real challenge is determining the correct key command to send. On a laptop or small Apple Wireless Keyboard, the command may include the fn modifier, but on a desktop machine with a full-size keyboard, the command will more probably be F11 alone. Furthermore, it's user-configurable.

The correct way to toggle Exposé programmatically is a separate question.

Peter Hosey