Jump to content

Send push on the same keybord key whatever the local or kebord type is


Recommended Posts

Helo,

Keybord does not have character placed in the same place following locale, language,...

I would like to simutate a push on certain place whathever the configuration is : 

On azerty : 

image.thumb.png.ff46b45f2c421d39a5ad0d7b365294c0.png

So : & a é - ,

and on dutch

image.png.89b672e226ba7848f49244a6cfc2da8b.png

So : 1 q 2 6 ,

Is here a way to allow that in autoit ?

Thanks a lot !

 

 

 

Link to comment
Share on other sites

My probram interract if an ofice soft and require a specific touch to be presst what ever the keybord local is.... For example '&' on french keyboard but '1' on us keyboard (th ekey is at the same position on the keyboard.  MANAGING KEYBORD LOCAL SEEMS OMPLICATED...

Link to comment
Share on other sites

Probably the easiest way is to maps all your keyboard layouts and use a simple function like that one:

Global $aFrenchLayout[$Rows][$Cols]
Global $aDutchLayout[$Rows][$Cols]

; Map all your keys
$aFrenchLayout[0][1] = '&'      ; Key in row 0 and column 1
$aDutchLayout[0][1] = '1'       ; Key in row 0 and column 1

Func SendKey($Row, $Col, $Layout)
    Send($Layout[$Row][$Col])
EndFunc

 

Link to comment
Share on other sites

yes but it seems that it's difficult to etect the current keyboard layout... im in french-belgium an if I change to DEU (deutch alemand), il continues to give me french belgium : 

image.png.d96b84ed618378586ae77fbe51bd766b.png

 

 

 

 

 

 

Link to comment
Share on other sites

I got out of a similar situation with the function below

#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w 7
#include <WinAPISys.au3>


sKey("^c")

ConsoleWrite(ClipGet() & @CRLF)


;----------------------------------------------------------------------------------------
Func sKey($sKey, $iCnt = 1, $iDelay = 50)
    ; English (United States) 0x0409, 0x04090409
    Local $Lang, $hWnd = WinGetHandle("[ACTIVE]")
    $Lang = _WinAPI_GetKeyboardLayout($hWnd)

    If $Lang <> "0x04090409" Then ; if not English then make it
        _WinAPI_SetKeyboardLayout($hWnd, "0x0409")
    EndIf

    For $i = 1 To $iCnt Step 1
        Send($sKey)
        Sleep($iDelay)
    Next

    If $Lang <> "0x04090409" Then ; If was others of English set it back
        _WinAPI_SetKeyboardLayout($hWnd, '0x' & StringRight($Lang, 4))
    EndIf

EndFunc   ;==>sKey
;----------------------------------------------------------------------------------------

more details here: https://www.autoitscript.com/forum/topic/209642

 

There is also the case: _WinAPI_RegisterHotKey - works with virtual-key codes regardless of keyboard layout

 

Take a look if it helps :)

I know that I know nothing

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...