Guns & Mental Health

A major idea being bounced around now (and even by the President) was to include a new qualification about buying guns based on mental health. Is this Constitutional?