Migrating from Windows

68 views
Skip to first unread message

skoivisto

unread,
Dec 21, 2009, 8:01:26 PM12/21/09
to autokey-users
Hello all,

I'm performing a Linux migration for a client of mine who is very
heavily entrenched in AutoHotKey in the Windows environment. I've
looked at the Autokey configuration files and it appears that it's
pretty heavy for expressions. Has anyone had any luck in scripting a
migration from AutoHotKey to AutoKey?

I think I read in the FAQs for AutoKey that a migration agent might be
available in future releases, any idea where that stands?

Thanks!

Luke Faraone

unread,
Dec 22, 2009, 5:36:05 PM12/22/09
to autokey-users
On Mon, Dec 21, 2009 at 20:01, skoivisto <skoi...@gmail.com> wrote:
I'm performing a Linux migration for a client of mine who is very
heavily entrenched in AutoHotKey in the Windows environment. I've
looked at the Autokey configuration files and it appears that it's
pretty heavy for expressions. Has anyone had any luck in scripting a
migration from AutoHotKey to AutoKey?

While theoretically possible, such a script would hardly be robust, as AutoKey might not implement all AutoHotKey idioms in a compatible fasion.

Anyway, any conversions at this point would have to be made by hand. Maybe somebody here could help if you posted some of the scripts you wanted to cross over.

--
Luke Faraone
http://luke.faraone.cc

Chris Dekter

unread,
Dec 22, 2009, 7:18:28 PM12/22/09
to autoke...@googlegroups.com
2009/12/23 Luke Faraone <lu...@faraone.cc>:

> While theoretically possible, such a script would hardly be robust, as
> AutoKey might not implement all AutoHotKey idioms in a compatible fasion.

Absolutely correct - there is no way that AutoKey and AHK can be
considered functionally equivalent. AHK has many features that AutoKey
doesn't, and probably never will have.

> Anyway, any conversions at this point would have to be made by hand. Maybe
> somebody here could help if you posted some of the scripts you wanted to
> cross over.

This is probably the best idea. I'm happy to assist with this as well.

Mike K

unread,
Jan 4, 2010, 1:38:20 PM1/4/10
to autokey-users
I'd be happy to take y'all up on that:


;--------------------

;; AHK FUNCTIONS

;--------------------

~^s:: ;;Save and Reload current script

SetTitleMatchMode, 2 ;to correctly detect Notepad++ windows

IfWinActive, %A_ScriptName%

{

SplashTextOn,200,,Updated script,

Sleep, 300

SplashTextOff

Reload

}

SetTitleMatchMode, 1

return

;--------------------

;;CapsLock & h AutoHotstring

;--------------------

;CapsLock & i:: ;;Run Intellisense

;Run IntelliSense.ahk

;Return

;--------------------

CapsLock & s:: ;;Open AHK Scripts Folder

Run, "%A_ProgramFiles%\AutoHotkey\Extras\Scripts"

Return

;--------------------

CapsLock & F1:: ;;Edit Script/Open AHK Help

Run, %A_ProgramFiles%/notepad++/notepad++.exe "%A_ScriptDir%\
%A_ScriptName%"

Run %A_ProgramFiles%/autohotkey/AutoHotkey.chm

Run IntelliSense.ahk

WinMove, AutoHotkey.ahk, 0, 66, 617, 1134

WinMove, AutoHotkey Help, 615, 66, 951, 1134

Return

;--------------------

CapsLock & z:: ;;Show this list

ViewKeyListFromHK(A_ScriptFullPath)

Return

;--------------------

;; WINDOW CONTROL

;--------------------

LWin & LControl::AltTab ;;Alt Tab

#Left:: WinMinimizeAll ;;Show Desktop

#Right:: WinMinimizeAllUndo ;;Restore All WIndows

#Down:: WinMinimize, A ;;Minimize Current Window

#Up:: ;;Maximize/Restore Window

WinGet MX, MinMax, A

If MX

WinRestore A

Else WinMaximize A

return

#Enter:: WinMove,A,,0,66, 1570, 1134 ;;Fit Screen

;Insert Key closes Tab/Window

#IfWinActive ahk_class MozillaUIWindowClass

Insert::Send ^w ;;Close Tab/Window

#IfWinActive ahk_class IEFrame

Insert::Send ^w

#IfWinActive ahk_class Chrome_VistaFrame

Insert::Send ^w

#IfWinActive

Insert::Send !{F4}

#0:: WinSet, Transparent, 60, A ;;Make Active window transparent

#-:: ;;Increase Transparency

WinGet, trans, Transparent, A

If trans =

trans = 255

If trans > 50

trans -= 50

Else trans = 0

WinSet, Transparent, %trans%, A

return

#=:: ;;Decrease Transparency

WinGet, trans, Transparent, A

If trans =

trans = Off

If trans <= 205

trans += 50

Else trans = Off

WinSet, Transparent, %trans%, A

return

#Backspace:: WinSet, Transparent, Off, A ;;Make Active window opaque

#PgUp::WinSet,AlwaysOnTop,Toggle,A ;;Always On Top

;--------------------

;; VOLUME/MULTIMEDIA

;--------------------

CapsLock & Up:: Send {Volume_Up} ;;Volume +

RShift & Up:: Send {Volume_Up} ;;Volume +

CapsLock & Down:: Send {Volume_Down} ;;Volume -

RShift & Down:: Send {Volume_Down} ;;Volume -

CapsLock & Space:: Send {Volume_Mute} ;;Mute

#IfWinNotActive, ahk_class eHome Render Window

$F8:: Send ^!+p ;;Pause

$F9:: Send ^!+s ;;Skip

!F8:: Send {F8} ;;

!F9:: Send {F9} ;;

#IfWinNotActive

;--------------------

;; OTHER HOTKEYS

;--------------------

SetTitleMatchMode, 2

CapsLock & p:: ControlSend, , ipconfig /all, cmd.exe ;;ipconfig -
testing

SetTitleMatchMode, 1

MButton:: ;;Middle Click Taskbar/Titlebar to Close

SetBatchLines, -1

CoordMode, Mouse, Screen

SetMouseDelay, -1 ; no pause after mouse clicks

SetKeyDelay, -1 ; no pause after keys sent

MouseGetPos, ClickX, ClickY, WindowUnderMouseID

WinActivate, ahk_id %WindowUnderMouseID%

; WM_NCHITTEST

SendMessage, 0x84,, ( ClickY << 16 )|ClickX,, ahk_id
%WindowUnderMouseID%

WM_NCHITTEST_Result =%ErrorLevel%

/*

#define HTERROR (-2)

#define HTTRANSPARENT (-1)

#define HTNOWHERE 0

#define HTCLIENT 1

#define HTCAPTION 2

#define HTSYSMENU 3

#define HTGROWBOX 4

#define HTSIZE HTGROWBOX

#define HTMENU 5

#define HTHSCROLL 6

#define HTVSCROLL 7

#define HTMINBUTTON 8

#define HTMAXBUTTON 9

#define HTLEFT 10

#define HTRIGHT 11

#define HTTOP 12

#define HTTOPLEFT 13

#define HTTOPRIGHT 14

#define HTBOTTOM 15

#define HTBOTTOMLEFT 16

#define HTBOTTOMRIGHT 17

#define HTBORDER 18

#define HTREDUCE HTMINBUTTON

#define HTZOOM HTMAXBUTTON

#define HTSIZEFIRST HTLEFT

#define HTSIZELAST HTBOTTOMRIGHT

#if(WINVER >= 0x0400)

#define HTOBJECT 19

#define HTCLOSE 20

#define HTHELP 21

*/

; Close taskbar program click

IfWinActive, ahk_class Shell_TrayWnd

{

MouseClick, Right, %ClickX%, %ClickY%

Sleep, 50

Send, c

WinWaitNotActive, ahk_class Shell_TrayWnd,, 0.5 ; wait for save
dialog, etc

If ErrorLevel =1

Send, !{Tab}

Return

}

; Close window with titlebar click

If WM_NCHITTEST_Result in 2,3,8,9,20,21 ; in titlebar enclosed area
- top of window

{

PostMessage, 0x112, 0xF060,,, ahk_id %WindowUnderMouseID% ; 0x112
= WM_SYSCOMMAND, 0xF060 = SC_CLOSE

Return

}

; else send normal middle click

If GetKeyState("MButton", "P") ; The middle button is physically
down

MouseClick, Middle, %ClickX%, %ClickY%,, Down

Else

MouseClick, Middle, %ClickX%, %ClickY%

Return

;--------------------

Capslock:: Send {Backspace} ;;Backspace

Capslock & Shift:: Send {Capslock} ;;CapsLock

$-::Send, % GetKeyState("CapsLock","T") ? "_" : "-" ;;underscore if
CapsLock ON

$_::Send, % GetKeyState("CapsLock","T") ? "-" : "_" ;;dash if
CapsLock ON

;--------------------

#Insert:: ;;Sleep

DllCall("PowrProf\SetSuspendState", "int", 0, "int", 0, "int", 0)

Return

;--------------------

#Home:: ;;Monitor Off

Sleep 1000 ; if you use this with a hotkey, not sleeping will make it
so your keyboard input wakes up the monitor immediately

SendMessage 0x112, 0xF170, 1,,Program Manager ; send the monitor into
standby (off) mode

Return

;--------------------

#n:: ;;Create New Folder on Win-N

wingetclass, class, A

if class not in CabinetWClass,ExploreWClass

return

controlgettext, currentpath, Edit1, ahk_class %class%

InputBox, UserInput, New folder, New folder name, , 130,
130,,,,,NewFolder

if ErrorLevel = 0

{

ifExist, %currentpath%/%UserInput%

FileCreateDir, %currentpath%/%UserInput%_1

else

FileCreateDir, %currentpath%/%UserInput%

}

Send {F5}

return

Thanks in advance!

On Dec 22 2009, 7:18 pm, Chris Dekter <cdek...@gmail.com> wrote:
> 2009/12/23 Luke Faraone <l...@faraone.cc>:

Reply all
Reply to author
Forward
0 new messages