GetKeyState broken for VK_NUMLOCK, _SCROLL, _CAPITAL when changes occur without window focus
Original Reporter info from Mantis: kalixo
-
Reporter name:
Original Reporter info from Mantis: kalixo
- Reporter name:
Description:
I cannot get the correct KeyState for the "switch" keys, if their switch happened outside of a fpc program, that is, on program startup they are not correctly reported, only if I switch them during the time my form has the focus, they get "toggled", but are not necessary "absolutely right" (they may toggle on-off while in reality I toggled off-on).
Steps to reproduce:
1.) set Numlock on
2.) start Program, e.g.:
procedure TForm1.Button1Click(Sender: TObject);
begin
Label1.Caption := 'numlock ' + IfThen((GetKeyState(VK_NUMLOCK) and $1) = $1, 'on', 'off') +
' ' + 'scrolllock' + IfThen((GetKeyState(VK_SCROLL) and $1) = $1, 'on', 'off') +
' ' + 'caps' + IfThen((GetKeyState(VK_CAPITAL) and $1) = $1, 'on', 'off');
end;
3.) Push button: Numlock will be reported as "off" - which is wrong
Additional information:
relevant source file might be lcl/interfaces/gtk2/gtk2winapi.inc
Mantis conversion info:
- Mantis ID: 33828
- Platform: Linux
- Version: 1.8