GetKeyState(VK_CAPITAL) & 0x0001

0x8000 是键有否按下
0x0001 是键的翻转状态

var
bF1Down: Boolean;
begin
bF1Down := (GetKeyState(VK_SPACE) and $8000 > 0);

05-11 13:37