When 5 fingers touch, implement maximize/center toggle ?

Now I have made the centering trigger.I should create a another trigger for maximizing, but I need to determine whether the current window is already maximized. How can I check this condition or implement it?