; ; AutoHotkey Version: 1.x ; Language: English ; Platform: Win9x/NT ; Author: kli6891 (at gmail dot com) ; ; ; converts azerty to qwerty and vice versa ; #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. StringCaseSense on #SingleInstance force qwertyString := "``1234567890-=qwertyuiop[]\asdfghjkl;'zxcvbnm,./~!@#$%^&*()_+QWERTYUIOP{}|ASDFGHJKL:""ZXCVBNM<>?" azertyString := "²&é""'(-è_çàà)azertyuiop^$*qsdfghjklmùwxcvbn,;:!²1234567890°+AZERTYUIOP¨£µQSDFGHJKLM%WXCVBN?./§" ^+q:: ;; the keyboard is current in qwerty, so change text to azerty ClipSaved := ClipboardAll ;; make a backup of the clipboard send ^c ;; capture the selected text origStr := clipboard newString := "" Loop, PARSE, origStr { if (A_LoopField == A_Space) { newString := newString . " " continue } if (A_LoopField == A_Tab) { newString := newString . "`t" continue } if (A_LoopField == "`n") { newString := newString . "`n" continue } StringGetPos, origStrPos, qwertyString, %A_LoopField% origStrPos++ ; increment b/c StringGetPos returns 0 as the first char, and substr() accepts 1 as the first char newString := newString . SubStr(azertyString, origStrPos, 1) } Send {Del} Send %newString% Clipboard := ClipSaved ; restore clipboard ClipSaved = return ^+a:: ;; the keyboard is current in azerty, so change text to qwerty ClipSaved := ClipboardAll ;; make a backup of the clipboard send ^c ;; capture the selected text origStr := clipboard newString := "" Loop, PARSE, origStr { StringGetPos, origStrPos, azertyString, %A_LoopField% origStrPos++ ; increment b/c StringGetPos returns 0 as the first char, and substr() accepts 1 as the first char newString := newString . SubStr(qwertyString, origStrPos, 1) } Send {Del} Send %newString% Clipboard := ClipSaved ; restore clipboard ClipSaved = return