Automating keyboard command


forneus

Well-known member
Local time
3:52 AM
Posts
44
OS
W11 Home 24H2
Need an on-screen keyboard pop up automatically when I switch my input language (Ctrl+Shift). Is this a task for Power Automate (new to this tool)? Or can this combination (as hot keys) do two functions at once - switching my input language and opening on-screen keyboard?
 

My Computer My Computer

At a glance

W11 Home 24H2Intel Core i5-1135G716 GB (LPDDR4x, 4266MHz)Intel Iris Xe
OS
W11 Home 24H2
Computer type
Laptop
Manufacturer/Model
Acer Swift 3x
CPU
Intel Core i5-1135G7
Memory
16 GB (LPDDR4x, 4266MHz)
Graphics Card(s)
Intel Iris Xe

My Computers My Computers

  • At a glance

    Windows 11 Proi716Gb
    OS
    Windows 11 Pro
    Computer type
    Laptop
    Manufacturer/Model
    Lafite 14
    CPU
    i7
    Memory
    16Gb
    Internet Speed
    150Mbps/39Mbps
    Browser
    Firefox
    Antivirus
    Defender
  • At a glance

    Win 11 Proi58Gb
    Operating System
    Win 11 Pro
    Computer type
    PC/Desktop
    Manufacturer/Model
    PC Specialist
    CPU
    i5
    Memory
    8Gb
    Internet Speed
    150Mbps/39Mbps
    Browser
    Firefox
    Antivirus
    Defender
    Other Info
    Incompatible Win 10 Pro PC upgraded to Win 11 Pro

My Computer My Computer

At a glance

W11 Home 24H2Intel Core i5-1135G716 GB (LPDDR4x, 4266MHz)Intel Iris Xe
OS
W11 Home 24H2
Computer type
Laptop
Manufacturer/Model
Acer Swift 3x
CPU
Intel Core i5-1135G7
Memory
16 GB (LPDDR4x, 4266MHz)
Graphics Card(s)
Intel Iris Xe
Regardless of how you decide to launch apps with a hotkey, you'll still need a wrapper script. Otherwise running On-Screen Keyboard makes no sense when you're switching back to your native input language.

This script assumes (for simplicity), there's only two possible input languages to switch from and picks the non-current language to switch. It checks if the new language isn't the native one, and only then runs On-Screen Keyboard.

SwitchInput.bat
Code:
@echo off
powershell -nop -ep bypass -C ""$NormalLanguage = (Get-Culture).Name; ^
Set-WinUserLanguageList (Get-WinUserLanguageList)[1].LanguageTag, (Get-WinUserLanguageList)[0].LanguageTag -Force -WarningAction Ignore; ^
if ((Get-WinUserLanguageList)[0].LanguageTag -ne $NormalLanguage) { ^
    if ((Get-Process -Name "osk" -ErrorAction Ignore).Count -eq 0) { osk.exe } ^
}""
 

My Computer My Computer

At a glance

Windows 7
OS
Windows 7
Back
Top Bottom