3

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

teezan
  • 31
  • 1
  • What are you hoping to do with this information? Do you think you just want to know the Exposé state at a given moment, or want full-on notifications as the state changes? Tell us what you're really trying to achieve. – Mike Abdullah Nov 25 '09 at 17:44
  • Hi Mike, thank you for your help. I am creating a program that emulates a multi-touch trackpad. As you know, if you swipe four fingers up in the normal state, it's just like you press fn+F11 keys. But if you swipe four fingers up in the Exposé state, it's like you press the Escape key. Therefore, for your question, I just want to know the Exposé state at a given moment. – teezan Nov 25 '09 at 20:24
  • I'd suggest you rename this question to "How to *toggle* exposé programmatically". I'm sure there's a way to do so in one fell swoop. – Benji XVI Nov 25 '09 at 21:59
  • I think there are already programs that can do this. I would suggest checking if they're open source so you might look at their code. Otherwise, try monitoring for notifications that may get sent when Exposé is activated. – jtbandes Nov 26 '09 at 02:35

2 Answers2

1

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

Joshua Nozzi
  • 60,946
  • 14
  • 140
  • 135
  • 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 Nov 25 '09 at 20:23
0

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
  • 95,783
  • 15
  • 211
  • 370