mIRC merges the windows' messages WM_KEYDOWN and WM_SYSKEYDOWN together to trigger the on keydown event.
However there is a lack of support for building your own editbox in picture windows, mainly (if not only).
For example with a french keyboard conf, the key '^' is a dead key. Pressing it once does nothing, it's used in combination with a letter, to accentuate it.
bug get fixed, $keyval should report 221 (VK_OEM_6) for the first keypress (with no $keychar), and then the value of the new key pressed (94 if you press ^ twice).
One cannot check for that case as anyone can create any keyboard with any layout+driver and get this same situation for a different purpose, google suggest that it's not possible to handle, that one has to use WM_CHAR.
While I would prefer to keep one event, it's not possible to change on keydown now.
I would like to see mIRC trigger a new on keychar event to cater for this, which would trigger for WM_CHAR message, to get only the character resulting from key presses.