WindowsAPIのGetKeyState関数を使う。
if GetKeyState( VK_SHIFT ) and $8000 <> 0 then
//上位ビットが1ならShiftキーが押されている
if GetKeyState( VK_CONTROL ) >= 0 then
//上位ビットが1以外ならCTRLキーが押されていない
if GetKeyState( VK_CAPITAL ) and 1 > 0 then
//下位ビットが1ならトグルがオン=CapsLockキーがオン
if GetKeyState( VK_KANA ) and 1 = 0 then
//下位ビットが1以外ならトグルがオフ=KANAキーがオフ。