IN 1960, ROALD DAHL HAD NOT YET BECOME A HOUSEHOLD NAME. He had not yet written about a girl named Matilda who had powers of telekinesis, nor James and his giant peach, nor Willy Wonka and his extraordinary chocolate factory. Dahl was instead a writer of adult stories known for their macabre twists, such as a tale of a woman who killed her husband with a frozen leg of mutton, and got rid of the evidence by serving it to the investigating officers.

But something changed that year. Dahl’s third child, Theo, was born. And on a walk home with the family nanny in November, Theo, then four months old, was struck by a New York City taxicab and thrown from his baby carriage, shattering his skull.

Theo was rushed to New Lenox hospital. The infant had suffered multiple skull fractures and brain injury, which resulted in secondary hydrocephalus, a build-up of cerebral-spinal fluid on the brain. The hydrocephalus was treated with a Holter shunt, a device implanted in the cerebellum which rerouted the excess fluid. Shortly after the shunt placement, Theo’s hydrocephalus stabilized.

By January, the baby no longer smiled, and his eyes looked “bewildered.” Panicked, Roald rushed his son to a nearby hospital where doctors discovered that Theo’s shunt had clogged, causing the spinal fluid to back up and put pressure on his brain. The hydrocephalus had temporarily blinded him. Over the next nine months, Theo’s shunt would malfunction six more times, each time leaving him temporarily blind and at risk for permanent brain damage.

Dahl took the unorthodox step of talking with a fellow enthusiast of model airplanes. Stanley Wade was a hydraulic engineer, but was known to Dahl for his miniature engines, and the clever hydraulic pumps he crafted to keep the fuel lines from clogging. Dahl told Wade about his son’s problem, and talked him into designing a new shunt, using his hydraulic pumps as a model. The two got Theo’s neurosurgeon, Kenneth Till, to supervise their efforts.

The new Wade-Dahl-Till valve was ingenious. The old valve, the one in the malfunctioning Holder shunt, had a silicone covering on either end with a small slit in the middle, like the nipple on the end of a baby bottle, and the cerebral-spinal fluid was supposed to drain through it. Unfortunately, debris and reflux—common in patients who suffer from brain bleeds—could clog the tiny slits. The new valve replaced the silicon with two movable metal discs.

When fluid accumulated on the brain and flowed through the valve, pressure from the top would move the metal discs to an “open” position, allowing the fluid to drain through the bottom. But when the spinal fluid threatened to flow back through the valve, pressure from the bottom pushed the discs closed. If necessary, the cerebral spinal fluid could even be pumped through the valve by applying manual pressure through the patient’s scalp.

By 1962, Theo’s hydrocephalus had stabilized. But Dahl continued to put final touches on the Wade-Dahl-Till valve, and it moved into production early that same year. By midyear, the valve was transplanted into its first live patient, and the procedure was a resounding success. For the next several years, until medical technology progressed beyond it, the Wade-Dahl-Till valve helped an estimated 3,000 patients recover from secondary hydrocephalus.

Young Theo survived the episode with minimal problems, and grew to be a healthy adult. Roald Dahl didn’t pursue any other medical innovations, but did make one career shift. After his son’s harrowing episode, he began to write for children — a move that spread his clever touch to a much wider audience.