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

Post your working scripts, libraries and tools
User avatar
evilC
Posts: 4780
Joined: 27 Feb 2014, 12:30

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

20 Oct 2017, 16:16

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
User avatar
BGM
Posts: 488
Joined: 20 Nov 2013, 20:56
GitHub: bgmCoder
Contact:

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

18 Jan 2019, 21:03

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.

Return to “Scripts and Functions”

Who is online

Users browsing this forum: tmplinshi and 22 guests