Hotkey control my alternative

Post your working scripts, libraries and tools for AHK v1.1 and older
serzh82saratov
Posts: 137
Joined: 01 Jul 2017, 03:04

Hotkey control my alternative

12 Aug 2018, 03:39

Image

Download library

Russian FAQ (google translate page)

Simple example:

Code: Select all

#NoEnv
#SingleInstance Force
Gui, +AlwaysOnTop
Hotkey_IniPath(A_ScriptDir "\Hotkey.ini"), Hotkey_IniSection("Hotkeys")
Hotkey_Add("w300", "MyHotkey1", "G1KD", "*", "Save")
Hotkey_Add("wp y+10", "MyHotkey2", "G1KMLRJ", "*", "Save")
Gui, Add, Edit, Center vText wp
Gui, Show
Return

Save(Name) { 
    GuiControl, , Text, % Name " = " Hotkey_Write(Name)
}

GuiClose() {
    ExitApp
}
Extended example:

Code: Select all

#NoEnv
#SingleInstance Force

Hotkey_Arr("OnGroup", "OnGroupProc")
Hotkey_IniPath(A_ScriptDir "\Hotkey.ini")
Hotkey_IniSection("Hotkeys")

Loop 4
    GuiCreate(A_Index)
Return

OnGroupProc(arr) {
 	for k, v in arr.names
		names .= "`n" v
	WinGetPos, x, y, w, h, % "ahk_id" Hotkey_ID(arr.this)
	S_CoordModeToolTip := A_CoordModeToolTip
	CoordMode, ToolTip, Screen
	ToolTip, % "'" Hotkey_HKToStr(arr.value) "' уже назначено в группе номер: " arr.group names, x + w + 2, y + h + 2, 20
	CoordMode, ToolTip, %S_CoordModeToolTip%
	SetTimer HideTooltip20, -500
	Return

	HideTooltip20:
		ToolTip,,,, 20
		Return
}
GuiCreate(I) {
	Gui, New, -DPIScale +AlwaysOnTop +LabelGui
	Hotkey_Add("w300", I "Hotkey1", "KMLRJG1W", "*", "Save")
	Hotkey_Add("wp y+10", I "Hotkey2", "KMLRJDG1", "*", "Save")
	Hotkey_Add("wp y+10", I "Hotkey3", "KMLRJG1", "*", "Save")
	Gui, Show, % "y100 x" 100+(I-1)*450, Hotkey Gui %I%
}

Save(Name) {
    Hotkey_Write(Name)
}

GuiClose() {
    ExitApp
}
Last edited by serzh82saratov on 02 Feb 2020, 11:30, edited 1 time in total.
robodesign
Posts: 934
Joined: 30 Sep 2017, 03:59
Location: Romania
Contact:

Re: Hotkey control my alternative

16 Aug 2018, 09:50

An excellent library. Thank you very much and congratulations !

What is missing only is to have an easy way to update the hotkey controls, to resize or reposition.

Best regards, Marius. ...
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
Quick Picto Viewer: GitHub or forum.
AHK GDI+ expanded / compilation library (on GitHub)
My home page.
serzh82saratov
Posts: 137
Joined: 01 Jul 2017, 03:04

Re: Hotkey control my alternative

16 Aug 2018, 12:06

You mean this:

Code: Select all

GuiControl, Move, % Hotkey_ID("4Hotkey3"), x10 y10 w200 h60
UPD: 23:27 17.08.2018

Code: Select all

Hotkey_Move(Name, Option)
Hotkey_Disable(Name)
Hotkey_Hide(Name)
robodesign
Posts: 934
Joined: 30 Sep 2017, 03:59
Location: Romania
Contact:

Re: Hotkey control my alternative

21 Aug 2018, 11:33

very good , thank you very much
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
Quick Picto Viewer: GitHub or forum.
AHK GDI+ expanded / compilation library (on GitHub)
My home page.

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: No registered users and 76 guests