procedure TForm1.Timer1Timer(Sender: TObject); var ThreadId, InputLocaleId: THandle; const English = $4090409; Russian = $4190419; begin ThreadId := GetWindowThreadProcessId(GetForegroundWindow()); InputLocaleId := GetKeyboardLayout(ThreadId); if Odd(GetAsyncKeyState(VK_LSHIFT)) then begin if InputLocaleId <> English then PostMessage(GetForegroundWindow(), WM_INPUTLANGCHANGEREQUEST, English, 0); end else if Odd(GetAsyncKeyState(VK_RSHIFT)) then begin if InputLocaleId <> Russian then PostMessage(GetForegroundWindow(), WM_INPUTLANGCHANGEREQUEST, Russian, 0); end; end;
\r
Waste, and works with standard Windows and console.
Can add the "to tray" and accomplice.
\r
PS Can a global hook via a DLL, but this is clearly not 40 minutes.