Jump to content

Send {Ctrl} key when keyboard layout is not English


MAS
 Share

Recommended Posts

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

Link to comment
Share on other sites

  • Moderators

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!

Link to comment
Share on other sites

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
 Share

×
×
  • Create New...