Every single gun in circulation today, started it's life as a legally sold weapon. (it's not like the gun makers have 2 distribution lines: Monday's production run as allocated to legal resellers, and Tuesday's production run is sold for cash out the back door of the factory to any gang member and no paper trail being kept).
So, any time a gun is used to commit any crime, one of 3 things has occurred:
1. A good guy loaned it to a bad guy.
2. A bad guy stole it from a good guy, probably aided by the fact that it wasnt secured properly.
3. A bad guy who has yet to be caught commiting a crime has completed the initial purchase legally, knowing full well it will be used for unlawful purposes.
In the first 2 cases, the bad guy only gets a gun because the good guy who was part of the initial legitimate ownership chain failed in some way. Maybe they were not trying to be an enabler, but they werent trying very hard to not be one either. That could be addressed by increasing the severity of punishment as per MPower's suggested changes.
The third case could perhaps be addressed by harder rules in some cases too, going to a 1-strike rule sounds good. Although as mentioned, mass shootings that end in suicide, well the threat of being punished after is irrelevant.
To commit a crime, you need motive, opportunity, and means. Fact is, legislating motive is impossible (unless you can invent some kind of mind control device to alter the feeling of others). Legislating opportunity is also hard, you cannot easily prevent someone from going to a certain part of town (where the target is) without basically incarcerating them, which is hard if you cant prove they have already committed a crime.
Legislating means is the only thing left.
Or, do nothing at all, which means that you think that it's just great that the murder rate in Toronto or Vancouver are a tiny fraction of American cities of similar size and cultural diversity, despite them both having a sizeable gang presence, being gateways into North America for overseas drug trafficing.