Start recording from within plugin

I am creating a plugin and would like to be able to start recording in the DAW the normal way (by pressing R on the keyboard in my DAW) even when the plugin is the selected window. Is there any way to do this?