This has been driving me nuts. I tried movie identifier sites, and I can’t find anything relevant based on the key words I enter.
I think the movie was made in the 60’s, and it was very likely made for TV. It takes place around the turn of the century, 1890-1910, in an American city. The protagonist is a law enforcer/detective of some kind. He resembles Lee Marvin, but I’m pretty sure it’s a Lee Marvin knockoff. He’s tall, lanky, speaks in a gruff voice, and his face sports muttonchops and a close-cropped beard. He may have been a Texas lawman, but the story doesn’t take place there IIRC.
The scene I remember takes place in a court room, near the movie’s end. The protagonist’s friend is on trial for murder and takes the insanity plea. The defendant has half of his face covered in a black cloth, and he stares unblinking with his lone eye while the protagonist testifies. The lawyer asks the protagonist if he thinks the defendant is insane. The protagonist summarizes all the things the defendant did to rationalize this murder, and concludes “He’s as mad as a hatter.”
I also remember a brunette femme fatale tries to seduce the protagonist, but no more than that. The one-eyed defendant and “he’s as mad as a hatter” is what has lodged in my mind for decades.