I would say the current laws work quite well given the limitations of determining when someone is likely to do harm to themselves or others.
I don't know specifics of the time leading up to these various shooters committing these acts but I'd not be surprised to find that their families, friends and neighbors did not consider them to be a threat to anyone. If that is true, by what law would you predict such a thing?