I am trying to detect pressing F5 in an override of ProccessKeyPreview in which you get a "Message" object. I know you can cast the Message object to "Keys" and compare it with Keys.F5, but this does not work because pressing the letter 't' also satisfies the condition:
if ((Keys)m.WParam == Keys.F5)
{
}
The issue is that pressing 't' or F5 will both satisfy the condition because they both evaluate to: 116