linking display power button and screen-saver/lock

Hi,

I’m still relatively new to Macs - and I’m wondering whether someone has come up with an applescript (or other program which can accomplish this) to have the power button on the cinema display also trigger the screen saver.

The issue at hand is that I can configure the screen saver to ask for a password when I want to unlock it. Similarly, MacOS allows me the same for waking up the machine from sleep/suspend. Also, there is a setting which says whether the power button on the cinema display will turn off the display or shut down the machine.

Unfortunately, when the power button is configured to turn of the screen only, the screen stays unlocked until the screensaver may eventually kick in (or, I have to lock the screen manually before switching off the screen). Obviously, I could configure it to put the entire machine to sleep, but I don’t want that - I want processes on the machine to continue as is. Google searches so far have not come up with anything useful, and especially unfortunately - not even the Mac Geniuses at the local Apple shop seem to know an answer for this… :confused:

My question now is - has anyone tried this before? i.e. to link an action to the screen being switched off; or alternatively, replace the ‘shutdown’/‘suspend’ action triggered by screen-off with some other action?
(specifically - what I’m looking for is 'When I hit the power button on the Apple Cinema Display (and the display is currently on), then switch off the screen and lock the screen [or alternatively, lock the screen the moment I hit the power button to turn the screen back on]…