I will start by saying that although the El Paso, Texas shooter, Patrick Crusius, could be a sociopath, there is nothing to indicate that he suffers from a major disorder of mind and brain.  He simply exercises the sort of twisted logic that one would expect to find in someone that is extremely bigoted and intolerant toward a particular group of people (in this case, Hispanics).  Not all irrational people are necessarily mentally ill.  We should learn more in the coming days about his history. 
Now, having said that, if the subject of mass shootings should turn to the focus of keeping guns out of the hands of the mentally ill?  I am reminded of this legislation: 
On Tuesday February 28, 2017, President Donald Trump quietly signed a bill into law that rolled back an Obama-era regulation that made it harder for people with mental illnesses to purchase a gun.  This rule, which was finalized in December of 2016, added people who were receiving Social Security checks for mental illnesses deemed unfit to handle their own financial affairs to the national background check database.  Had the rule been allowed to fully take effect, the Obama administration estimated that it would have added about 75,000 names to that database.
President Barack Obama recommended the now-nullified (by President Donald Trump) regulation in a 2013 memo following the Sandy Hook Elementary School shooting, which left 26 people dead (including 20 children).  This measure's sole purpose was to block people with severe mental illnesses from being able to legally purchase guns.  However, the NRA opposed this measure... and predictably, Donald Trump caved in to their wishes and revoked the rule.