Taking a break from the tablets made 26-year-old Gregory Irvin feel 'less shy, more confident' said Siana Wilson, who was heavily pregnant with their child at the time.
Instead he had taken cocaine to give him 'relief' from his problems, Birmingham Crown Court heard.
The pair had met online in 2016 and moved in together two months later. Irvin and his grandmother, 74-year-old Anne James, were 'very fond' of each other and the couple used to visit her every Wednesday, she said. Mrs James even came to their Bilston flat for her baby shower, the jury heard.
On the day the pensioner was killed on February 28, Miss Wilson was days away from giving birth. Irvin had gone out to buy wine for his father's birthday and drop off paperwork at his parents' Walsall Wood home.
But CCTV footage played to the court showed Irvin park his blue Mini in Sandwell Street and walk up a track to his grandmother's listed terraced home in Doveridge Place.
Just 13 minutes later he left carrying a light-coloured item, which the prosecution suggest was the murder weapon, believed to be Mrs James' own bread knife, which has never been found. She had been stabbed more than 40 times.
Ms Wilson said his anxiety medication made Irvin feel 'a bit withdrawn', and he had stopped taking it while they were on holiday last year. She said: "It made him less shy, he was maybe a bit more confident."
Irvin, described as on the autistic spectrum, was arrested the day after the stabbing. A medical examination revealed he had taken cocaine the day before, while self-inflicted cuts were found on his thighs. He claimed he had made suicide attempts in the past.
Miss Wilson, who gave evidence from behind a screen, knew about his gambling debts but only found out the extent – £35,000 at its height – from his family. They split up for five months after Irvin lost his job, which had put a strain on the relationship, she daid.
His only income was universal credit payments and a monthly sum of £200 from a car trade-in, and he would ask his parents for money, causing arguments. His brother Matthew, 30, told police that when they refused to fund him, he would ask his grandmother. But she had been asked by the family not to give him any more money.
Irvin told police he took cocaine three or four times a week 'as a relief from problems he could not cope with,' Miss Rachel Brand, QC, prosecuting, told the jurty.
Irvin, of Bilboe Road, Bradley, Bilston, denies murder. The trial continues.