Page 1 of 1

AppFactory - Easily allow end-users to configure hotkeys and settings in your scripts

Posted: 20 Oct 2017, 16:16
by evilC
GitHub Page (Downloads)

Placeholder for now, I have written an AHK_L version of AppFactory

The thread for the AHK_H version is here, see there for full information.

TL/DR is this code

Code: Select all

#SingleInstance force
#NoEnv
#Include AppFactory.ahk

factory := new AppFactory()
factory.AddInputButton("HK1", "w200", Func("InputEvent").Bind("1"))
factory.AddInputButton("HK2", "xm w200", Func("InputEvent").Bind("2"))
factory.AddControl("MyEdit", "Edit", "xm w200", "Default Value", Func("GuiEvent").Bind("MyEdit"))
factory.AddControl("MyDDL", "DDL", "xm w200 AltSubmit", "One||Two|Three", Func("GuiEvent").Bind("MyDDL"))

Gui, Show, x0 y0
return

InputEvent(ctrl, state){
	Global factory
	Tooltip % "Input " ctrl " changed state to: " state " after " A_TickCount " ticks while MyEdit was '" factory.GuiControls.MyEdit.Get() "'"
}

GuiEvent(ctrl, state){
	Tooltip % "GuiControl " ctrl " changed state to: '" state "' after " A_TickCount " ticks"
}

^Esc::
GuiClose:
	ExitApp
Gives you this
Save / load settings
Custom hotkey GuiControl with "Bind Mode", turn on off blocking, wild mode etc, supports mouse + joystick buttons...

Image

Re: AppFactory - Easily allow end-users to configure hotkeys and settings in your scripts

Posted: 18 Jan 2019, 21:03
by BGM
Wow, this is really nice, but it also looks like a lot to digest.

I have a gui already, and just want a way to capture a hotkey that uses the win key. This is so I can save a user-selected global hotkey for my app. The default ahk hotkey control doesn't capture the winkey.

This library looks like overkill for my simple need.

Is there any documentation to go with it? I don't see any in the github page.
[edit]
Ah, I see it now - the info is all under the link for autohokey_h.