lbrtdy Posted May 29, 2009 Share Posted May 29, 2009 I type in a different keyboard layout -Dvorak- and when I try to use autoit to send something, it ends up sending the wrong key(s). Ie Send("s") it would go to the physical e on my keyboard and tries to send that, but it turn because of my layout, sends an "o". Is there a way to change it so that autoit sends it in a different way that overcomes my layout problems? Link to comment Share on other sites More sharing options...
Yashied Posted June 1, 2009 Share Posted June 1, 2009 I type in a different keyboard layout -Dvorak- and when I try to use autoit to send something, it ends up sending the wrong key(s). Ie Send("s") it would go to the physical e on my keyboard and tries to send that, but it turn because of my layout, sends an "o". Is there a way to change it so that autoit sends it in a different way that overcomes my layout problems?Maybe follows. expandcollapse popup#Include <WinAPI.au3> HotKeySet('^s', '_Send') HotKeySet('^q', '_Quit') While 1 Sleep(100) WEnd Func _Quit() Exit EndFunc ;==>_Quit Func _Send() $hWnd = WinGetHandle('[ACTIVE]') If @error Then Return EndIf $sLayout = _WinAPI_GetKeyboardLayout($hWnd) _WinAPI_SetKeyboardLayout('00000409', $hWnd) Send('Test' & @CRLF) _WinAPI_SetKeyboardLayout($sLayout, $hWnd) EndFunc ;==>_Send Func _WinAPI_GetKeyboardLayout($hWnd) Local $Ret = DllCall('user32.dll', 'long', 'GetWindowThreadProcessId', 'hwnd', $hWnd, 'ptr', 0) If (@error) Or ($Ret[0] = 0) Then Return SetError(1, 0, 0) EndIf $Ret = DllCall('user32.dll', 'long', 'GetKeyboardLayout', 'long', $Ret[0]) If (@error) Or ($Ret[0] = 0) Then Return SetError(1, 0, 0) EndIf Return '0000' & Hex($Ret[0], 4) EndFunc ;==>_WinAPI_GetKeyboardLayout Func _WinAPI_SetKeyboardLayout($sLayout, $hWnd) If Not _WinAPI_IsWindow($hWnd) Then Return SetError(1, 0, 0) EndIf Local $Ret = DllCall('user32.dll', 'long', 'LoadKeyboardLayout', 'str', StringFormat('%08s', StringStripWS($sLayout, 8)), 'int', 0) If (@error) Or ($Ret[0] = 0) Then Return SetError(1, 0, 0) EndIf DllCall('user32.dll', 'ptr', 'SendMessage', 'hwnd', $hWnd, 'int', 0x50, 'int', 1, 'int', $Ret[0]) Return SetError(0, 0, 1) EndFunc ;==>_WinAPI_SetKeyboardLayout My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
lbrtdy Posted June 18, 2009 Author Share Posted June 18, 2009 (edited) No that didn't work, the thing is that my Windows is set as default Qwerty layout, I didn't touch it. But I run a program written in autohotkey that remaps the whole keyboard. So is there what is equivalent to autohotkey's SendMode, input or Sendmode, Raw in autoit? So it would ignore the current configuration of the keyboard and just sends the text specified? I'm not referring to sending raw as it send ! would equal alt, but as it Send o it won't go to o on my keyboard and sends that, but due to my layout it sends an "r". Edited June 18, 2009 by lbrtdy Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now