Automating keyboard command


forneus

Active member
Local time
5:58 PM
Posts
38
OS
W11 Home 23H2
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

System One

  • OS
    W11 Home 23H2
    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

System One System Two

  • OS
    Windows 11 Pro
    Computer type
    Laptop
    Manufacturer/Model
    Lafite 14
    CPU
    i7
    Memory
    16Gb
    Internet Speed
    150Mbps/39Mbps
    Browser
    Firefox
  • Operating System
    Win 11 Pro
    Computer type
    PC/Desktop
    Manufacturer/Model
    PC Specialist
    CPU
    i5
    Memory
    8Gb
    Internet Speed
    150Mbps/39Mbps
    Browser
    Firefox
    Other Info
    Incompatible device, upgraded to Win 11

My Computer

System One

  • OS
    W11 Home 23H2
    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

System One

  • OS
    Windows 7

Latest Support Threads

Back
Top Bottom