auto copy selected text to clipboard

I want to catch the event of selecting text in some editor. Then I can apply some actions to the selected texts. One requirement I want to implement is that after selecting the text, the selected text will store into the system's clipboard automatically.