What you need is to have a keyboard listener to watch for a keyboard event. If the button pressed is F11 (keycode 16), then do something with your window. A simple script is here. Just take a look and see if you can modify to your need.
Taywin
Posting Maven
2,633 posts since Apr 2010
Reputation Points: 275
Solved Threads: 375
Skill Endorsements: 17