Two years ago, Oregon lawmakers passed a gun control measure that some experts say could have helped prevent mass shootings in Texas and Ohio last weekend.

Now President Donald Trump is also talking about "extreme risk protection orders" as a possible way to reduce gun massacres.

Here's how they work—and whether they're working in Oregon.

What did Oregon pass?

In 2017, the Oregon Legislature passed Senate Bill 941. As WW reported this April, the bill had bipartisan support: Longtime gun control champion Sen. Ginny Burdick (D-Portland) sponsored it with Sen. Brian Boquist (R-Dallas). Boquist is a fiery conservative. But his stepson fatally shot himself.

What Boquist sponsored was an "extreme risk protection order," or ERPO, law. Such laws—commonly nicknamed "red flag laws"—are based on the idea that most people who use guns to harm themselves or others display behavioral warning signs, or "red flags," before acts of violence. The laws allow family members or law enforcement officers to petition a court directly for an extreme risk protection order, which temporarily restricts an individual's access to firearms and/or revokes any license the person might have.

The Oregon form asks if the individual has a past criminal background; any history of suicide threats or attempts, of using physical force or violence against other people, of unlawful use of controlled substances, of unlawful or reckless use of a deadly weapon, of previous family abuse; or has violated a restraining order or recently acquired a deadly weapon.

Is it working?

Oregon's red flag law took effect Jan. 1, 2018. In its first 18 months, 117 petitions were filed. Ninety-two of them were granted and 25 denied. That's a little over a three-quarters "success rate" in taking guns away from troubled people. (Typical grounds for denial included the party petitioning for the order wasn't eligible to do so, refused to appear in court, or couldn't provide sufficient evidence.)

Is anybody else trying this?

Seventeen states have enacted similar legislation, according to the Giffords Law Center to Prevent Gun Violence. But not all red flag laws are created equal.

First, not everyone can request an ERPO. In Oregon, family members as well as law enforcement officers may file petitions for one; in other states, mental health providers, educators, and even co-workers can apply as well.

And the procedures for removing firearms vary. Some states rely on respondents' cooperation, while Oregon and others issue warrants for weapon seizure right alongside the ERPO. And finally, not all restrictions are the same. Most state orders, including Oregon's, revoke firearm access for one year. In Illinois and Vermont, orders may apply for less than six months, but in New Jersey, they last indefinitely.

So would laws like these have stopped the tragedies in El Paso, Texas, or Dayton, Ohio?

It's not clear.

Penny Okamoto, executive director of Ceasefire Oregon, says ERPOs help prevent tragedies, but they're only effective when individuals understand and can access them. "ERPOs are necessary," she says, "but they're not sufficient."

The mass murderer in El Paso has been linked to a document containing blatantly racist sentiments and indicating a premeditated attack. But that document appeared only a half-hour before the shooting, too late to be used as evidence for an extreme risk order, which takes a minimum of 24 hours for a response.

Former high school classmates of the shooter in Dayton said he had an unusual fascination with killing and violence—and once caused a school lockdown by writing a "hit list" on a lavatory wall. But that was nearly seven years ago; an annual, renewable ERPO, like that issued in most states, might not have prevented his violence.

It's for this reason that Okamoto thinks there's still more to be done. "The Ohio shooter killed and injured dozens of people in under a minute," she says. "We need to get rid of these killing machines."