South Charleston's ordinance also states that gun buyers must follow all federal and state laws, Mayor Frank Mullens said.
"I have no problem with people's right to bear arms," Mullens said. "But I don't think people should be able to carry a gun into the South Charleston Community Center."
However, Mullens thinks cities should be able to regulate firearms sales in their communities and the decisions should not be made on the state level.
Mullens said his officers have not had occasion to enforce the ordinance prohibiting people from carrying firearms in city buildings.
Officers would rely on complaints about such instances, Police Chief Brad Rinehart said.
"I've been here for five years, and we've never had any problems," he said.
Officers in Dunbar would have to either see someone carrying a gun into a municipal building or receive a complaint to know if the ordinance was being violated, Mayor Jack Yeager said. He could think of no such instances.
Martinsburg Mayor George Karos and Police Chief Kevin Miller say officers in the Eastern Panhandle city have had no reported violations to deal with.
Martinsburg's ordinance specifically states that the officer must ask the person carrying the gun to leave the premises before an arrest can be made, Miller said.
"But we've never had to arrest anyone on this," he said.
Martinsburg's main concern was keeping guns out of City Hall, where municipal court is held, Karos said.
"We did this to protect our employees in City Hall," he said. "And I think it has worked extremely well."
Charleston Council President Tom Lane was the architect of his city's ordinance.
Lane, a Republican, believes the ordinance has worked very well although he lacks concrete evidence.
Drug dealers from big cities were coming to Charleston to sell drugs and buy guns. They could get higher prices for drugs here than in their own cities. By the same token, guns were cheaper in Charleston and could be sold in the bigger cities at high markups, Lane said.
Lane believes the ordinance was successful in reducing, or possibly even eliminating, this practice.
"I'm convinced this impediment we threw at the drug dealers caused them to at the very least go someplace else," he said.
Eight businesses in Charleston have licenses to sell firearms, according to the City Collector's office. That includes large retailers like Cabela's and Gander Mountain.
In 2012, 2,459 handguns were sold in the city, Beckett said.
Beckett did not have figures for handgun sales prior to 2012.