First, I agree with Shalimar. However, I would answer to the last line in her post by saying, "We haven't learned to do that yet."
Preventing school shootings is not fixing just one thing. If it was that simple, surely someone would have figured it out by now. So, we can now say that it's not the parents, it's not the video games, it's not adding security to schools (Sandy Hook proved that), it's not the easy access to guns, it's not because a kid was rejected by a girl and it's not even the mental breakdown or bullying of the child. However, the reports that we (the police) are getting states very simply that it is collectively a number of things that goes wrong in a child's mind that brings about a school shooter.
In each case of a school shooting from Columbine to Parkland, one thing has been constant. Before the shooting began, the shooter told another student, who turned a deaf ear. THIS is what has to stop. It's a well known fact that kids do not share their inner most secrets with adults. It's some kind of pact that they (kids) have. Oh, they don't talk about it or take an oath, but nonetheless, it is an unwritten pact. I remember back when Columbine took place and the day before the shooting happened, I forget which shooter it was, told another student, "Don't come to school tomorrow." Back in my day, we had "tattle-tales" all over the place. I remember being outside for recess while in elementary school on one afternoon with my buddy throwing a ball back and forth and a girl saw me spit on the playground. The next day, the teacher had me stand up in class and she asked me if I did that. I thought about lying, but I told her that I did. She then told me that I had to stay indoors that day during all three recesses.
If any kid that got wind of a shooting that was being planned would immediately report it, at the very least, some of these shootings could be prevented. Now, this is not to say that maybe at least one of the other reasons for a shooting that has happened that I listed earlier in this post could also be a contributing factor, but psychiatrists have stated over and over that kids become shooters for various reasons. Of course, if guns weren't so readily accessible, it may also prevent some of the shootings, but again, if a person (or kid) wants to carry out a mass carnage by shooting their classmates, they will do it.
Bottom line here is, there is no 'one" answer that will stop shooters, unless all guns from our society are removed and we can all say with certainty; that isn't going to happen. As it stands now, we are waiting to see where the next shooting will take place. I hope parents have spoken with their children and have "discussed" with them the various ways that they can help themselves stay safe in school and what to do in case a shooting does break out. I wish that all school classrooms had double-hung windows that could be raised and the children could have an escape route out the window, even if they are on the second floor. If it were me, I would rather take a chance jumping out a second floor window than facing down a shooter holding an AR-15. A broken leg can be fixed, whereas; a hole in your heart or head cannot.
The last paper that I read on this subject spoke about parents should be talking with their children everyday and especially about what their day was like at school. Sometimes, there are telltale signs that come out and if the parent is listening close enough, they may be able to pick up on something that the child is having an issue with and that together, the child and the parent can work on to fix.