I've noticed an weird behavior, i have the main form(called frmMain) and a dialog box(called dlgBuscaProduto).
frmMain has KeyPreview enabled and there is a case statement to handle the VK_F5 key and show dlgBuscaProduto.
dlgBuscaProduto has KeyPreview enabled, and OnKeyDown it handles the VK_ESCAPE to have ModalResult := mrCancel;, the DBGrid has two event handlers, OnDblClick that have ModalResult :=mrOK; and also OnKeyDown checking if the Key = VK_RETURN then ModalResult := mrOK;
When i press F5 the frmMain.OnKeyDown is triggered and opens up dlgBuscaProduto, if i solely navigate with the keyboard(write on the edit, press enter which set focus to the DBGrid, then i navigate the DBGrid with arrow keys and press enter, then the TFrmMain.OnKeyDown with the VK_F5 is triggered again, however when i do with the mouse and do the DblClick on the DBGrid it works as expected, i made a screen recording debugging, it will probably explain it a little better.
Note: i even tried to add an Application.ProcessMessages after calling dlgBuscaProduto and it still behaves oddly.
https://youtu.be/zcZUHl6gKJM