Emulating modifiers keys ?

We handle an external UI input device and want some controls on this device to emulate standard modifiers keys of the keyboard, how to ?
CGPostKeyboardEvent() documentation.

NB
Source code of OpenSource VNC applications are a good source of inspiration for this kind of requirements.
Look at the Core Graphics