Gracias a
marconi por esta corrección al truco:
La función
StringToVKey hace una búsqueda alfabética y para eso,
SendKeyRecs debe estar ordenado o algunas teclas (como F10) no las encontrará.
La definición correcta de
SendKeyRecs será:
Código Delphi
[-]
SendKeyRecs : array[1..MaxSendKeyRecs] of TSendKey =
(
(Nome:'BACKSPACE'; VTecla:VK_BACK),
(Nome:'BKSP'; VTecla:VK_BACK),
(Nome:'BREAK'; VTecla:VK_CANCEL),
(Nome:'BS'; VTecla:VK_BACK),
(Nome:'CAPSLOCK'; VTecla:VK_CAPITAL),
(Nome:'CLEAR'; VTecla:VK_CLEAR),
(Nome:'DEL'; VTecla:VK_DELETE),
(Nome:'DELETE'; VTecla:VK_DELETE),
(Nome:'DOWN'; VTecla:VK_DOWN),
(Nome:'END'; VTecla:VK_END),
(Nome:'ENTER'; VTecla:VK_RETURN),
(Nome:'ESC'; VTecla:VK_ESCAPE),
(Nome:'ESCAPE'; VTecla:VK_ESCAPE),
(Nome:'F1'; VTecla:VK_F1),
(Nome:'F10'; VTecla:VK_F10),
(Nome:'F11'; VTecla:VK_F11),
(Nome:'F12'; VTecla:VK_F12),
(Nome:'F13'; VTecla:VK_F13),
(Nome:'F14'; VTecla:VK_F14),
(Nome:'F15'; VTecla:VK_F15),
(Nome:'F16'; VTecla:VK_F16),
(Nome:'F2'; VTecla:VK_F2),
(Nome:'F3'; VTecla:VK_F3),
(Nome:'F4'; VTecla:VK_F4),
(Nome:'F5'; VTecla:VK_F5),
(Nome:'F6'; VTecla:VK_F6),
(Nome:'F7'; VTecla:VK_F7),
(Nome:'F8'; VTecla:VK_F8),
(Nome:'F9'; VTecla:VK_F9),
(Nome:'HELP'; VTecla:VK_HELP),
(Nome:'HOME'; VTecla:VK_HOME),
(Nome:'INS'; VTecla:VK_INSERT),
(Nome:'LEFT'; VTecla:VK_LEFT),
(Nome:'NUMLOCK'; VTecla:VK_NUMLOCK),
(Nome:'PGDN'; VTecla:VK_NEXT),
(Nome:'PGUP'; VTecla:VK_PRIOR),
(Nome:'PRTSC'; VTecla:VK_PRINT),
(Nome:'RIGHT'; VTecla:VK_RIGHT),
(Nome:'SCROLLLOCK'; VTecla:VK_SCROLL),
(Nome:'TAB'; VTecla:VK_TAB),
(Nome:'UP'; VTecla:VK_UP)
);