How can I know if the user is in Exposé mode?

212 Views Asked by At

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

2

There are 2 best solutions below

1
On

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

0
On

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.