Jump to content

Recommended Posts

Posted

Hello all 

I'm trying to send keys to a program and it works well, but if I changed the keyboard layout to language other than English

it fails

ex:

Run("Notepad.exe")
$hWnd = WinWait("Untitled - Notepad2")
WinActivate($hWnd)
ControlSend($hWnd, "", "", "^s")

this works and opens the save as dialogue if I'm using English keyboard only not Arabic keyboard for example

I've tried using in send command

{CTRL} , {LCTRL} , {RCTRL}

but didn't work

so how I automatically change keyboard if it's not English and then send the keys

or what I should do

 

Thanks

  • Moderators
Posted

Have you tried _WINAPI_Keybd_Event? Something like this (untested):

 #include <WinAPISys.au3>
 
_WinAPI_Keybd_Event ( 0x11, $KEYEVENTF_EXTENDEDKEY)
_WinAPI_Keybd_Event ( 0x11, $KEYEVENTF_KEYUP)

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Posted (edited)

is there anyway to change the current using language after I get it from @KBLayout

Edited by MAS

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...