get form name from custom controller

How is possible to get the current form name in a method triggered from the custom controller?
This method should have different behaviour based on the form and the table that is in use.

Do you mean this:
currentcontroller.getName()//returns formName of the currenty showing main form