Maggie Gyllenhaal in “Hysteria.”

However it’s handled, the story of the invention of the electric vibrator would benefit from better treatment than “Hysteria,” a film left wanting for a tone and a surer sense of the times.

The stylistically uncertain romantic comedy stars Maggie Gyllenhaal as the late 19th-century social reformer daughter of London’s (fictional) Dr. Dalrymple, played by Jonathan Pryce. The doctor’s successful treatment of society ladies diagnosed, willy-nilly and with cluelessness, with various forms of hysteria has led to a thriving practice. Dalrymple has enough business, in fact, to hire an assistant, a character inspired by the historical record: Dr. Mortimer Granville (Hugh Dancy).

True to his times, Granville, like Dalrymple, considers the treatment to be a purely clinical exercise. Meanwhile, Granville plans to marry Dalrymple’s other daughter (Felicity Jones), a more classically Victorian model than her “Major Barbara”-style sister.

As “Hysteria” nudges Dancy’s and Gyllenhaal’s characters together, by way of periodic spats and verbal sparring matches, the screenplay imagines how, precisely, Granville’s gadget freak pal (played, with extreme broadness, by Rupert Everett) inspired Granville in his “Eureka!” flash: the creation of the electric device. The director of “Hysteria,” Tanya Wexler, has some fun with all this, though sensibly she has no interest in burlesquing the subject.

The picture’s heart belongs to Gyllenhaal’s ultra-modern feminist: the enlightened antidote to all the simpy, repressed attitudes swirling around her good works and itchy exasperation.

And that’s a considerable part of the problem. This key character doesn’t seem like a woman ahead of her own corseted time; rather, especially as Gyllenhaal delivers her, Charlotte is like a time-traveler from a century ahead. You don’t believe in her in the context of the film’s setting. Also, the movie lacks wit.

And the heartbreaking postscript?

Playwright Sarah Ruhl just wrote a wonderful theatrical exploration of a similar subject (“In the Next Room”), and now that one won’t get the screen adaptation it deserves.