When the boys were born earlier than expected, Federer consulted with his wife and team about playing the Italian Open.
"And they all said I should quickly come and play here. So I was like, OK, if you don't want me around I'll go away," Federer recounted Tuesday. "That was basically it.
"Things went well, the boys are healthy. Mirka's good, too," the 17-time Grand Slam champion added. "So it's a great time in our lives right now."
The boys' names are Leo and Lenny.
"Boys names are hard. It was all last minute," Federer said. "Girls, I feel like there's so many nice names and they're all cute but with boys it's totally a different story.
"I miss them a lot already and also the girls," the fourth-ranked Swiss player said. "It's a different type of week but I'll get through it and I hope I can still play some good tennis."
The couple's twin girls, Myla Rose and Charlene Riva, will turn 5 in July.
"This time around, we kind of know how to handle kids on the road," the 32-year-old Federer said. "I'm aware it's going to be a lot of work but at the same time I know what I'm getting into. So it's something I'm very much looking forward to. ... There will be a long time without any traveling after the tennis is over, so I'm looking forward to the next couple of years now."
Federer had a strong start to the clay-court season by reaching the final of the Monte Carlo Masters. The Italian Open is the last key warmup for the French Open, which starts in less than two weeks.
"I expect a lot from myself but then after what happened I come here a bit more laid back, just enjoy it," Federer said. "I've had such a good start to the season that I want to just keep momentum on my side.
"I didn't want too big a break. And it doesn't matter whether I play five matches or one match here, as long as I stay with the pulse of things on tour. Of course I hope I can win my first-round match but at the moment I have totally different priorities."
A three-time finalist in Rome, including last year, Federer opens Wednesday against 47th-ranked Jeremy Chardy of France.