F.Key-Commander Tool

Veröffentliche deine funktionierenden Skripte und Funktionen

Moderator: jNizM

daterone
Posts: 6
Joined: 08 Mar 2021, 17:00

F.Key-Commander Tool

Post by daterone » 07 Apr 2021, 11:38

Hallo,
ich habe da was Programmiert, was auch andere gebrauchen können.
Beim ersten Start wird eine HTML und fkey.ini Datei gespeichert, die HTML-Datei ist die Hilfe-Datei.
Man kann die F1-F8 Tasten sowie qq1-qq8 und RETURN u. TAB mit Funktionen belegen. Im erster Überlegung
ist das nichts neues, aber schaut mal die Hilfe, da habe ich unten ein Beispiel wie es aussehen könnte.

Der Programm-Code ist auch sehr einfach gehalten, wer will kann da was draus machen.

F.Key.Commander ist ein kleines Tool um immer wiederkehrende Aufgaben – Eingaben zu erleichtern.
In der fkey.ini Datei wird durch Befehle einzelne Funktion für Eine Funktionstasten kann unterschiedliche Funktionen ausführen, abhängig vom Fenster oder Programm.

Das Programm wurde in AutoHotkey geschrieben, für mehr Information kann die HelpPage „https://www.autohotkey.com/docs/AutoHotkey.htm“ hilfreich sein.
Und für Keystrokes {left} {up}… bitte auf „https://www.autohotkey.com/docs/KeyList.htm“ schauen.

Ich verwende den FKey.Commander im Büro da ich bei der Auftragsbearbeitung durch sinnvolle
Belegungen mir die Tipper- und Clickerei sehr erleichtert und fehlerfreiere Eingabe ermöglicht.

Update 18.04.21

Code: Select all

;F-KEY-Command Writte by MM-WB- opensource 18.04.2021
;Programm und Source - OpenSource - 
;AutoHotKey Version 1.1.31.01
;Run Programm and Read the HTML-HELP ALT & 3 
#SingleInstance force
ListLines, Off
SetWinDelay,-1
SetControlDelay, -1
SetTitleMatchMode, 2
SetTitleMatchMode, slow

goenter=
gotab=
F1=
F2=
F3=
F4=
F5=
F6=
F7=
F8=

;#########################################################################

rexcommands=i)(WaitWindow|setvar|addchar|Suspend|WinMove|ControlMove|WinGetActiveTitle|WinSetTitle|WINMAX|WINMIN|WINRESTORE|INFO|LOADNEWCONFIG|CLRGADGET|IFexeBreak|IfNotTextBreak|ControlClick|REPLACE|ADDUSER|CONVERT|EXIT|ADDFILE|IF|GETTEXT|SETCLIPBOARD|COPYCLIPBOARD|PASTECLIPBOARD|WINDOW|CLOSEAPP|FOCUS|MC|APP|INPUT|WINACT|SENDUSER|SENDINPUT|SEND|SLEEP|MSGBOX|SENDCONTROL)\s*\((.*?)\)

;#########################################################################

Menu, TRAY, NoStandard
menu, Tray,NoDefault
Menu, Tray, Icon, C:\WINDOWS\system32\imageres.dll,92,1
Menu, Tray, Add,EXIT, MenuHandler 
Menu, Tray, Add,Watch Mouse [ALT & 1], MenuHandler
Menu, Tray, Add,Edit config [ALT & 2], MenuHandler 
Menu, Tray, Add,Help [ALT & 3], MenuHandler 
Menu, Tray, Add,Restart [ALT & 4], MenuHandler 
Menu, Tray, Add,All Hotkey >OFF<, MenuHandler 


;#########################################################################
;# simple Config #########################################################
;#########################################################################

configfile=key.ini
ifnotExist,%configfile%		; wenn keine Config vorhanden ist.
	{

nc=
(
#Mnimal Test config
[MAIN]
RUNMODE=all
SHOWSTARTUP=YES
F1=notepad.exe[[input(Hello);msgbox(%user%);msgbox(Type >qq1<)]]
F2=app(notepad.exe)
[qq]
q1=Ich tippe Autohotkey
q2=notepad.exe[[msgbox(wau)]]
)

	FileAppend, %nc%,%configfile%
	}

;#########################################################################
;# Read All - Startup-Config #############################################
;#########################################################################

IniRead,runmode,%configfile%,MAIN,RUNMODE,%A_Space%
if runmode !
	runmode=window

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

IniRead,showstartup,%configfile%,MAIN,showstartup,%A_Space%
if showstartup !
	showstartup=yes

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

loadconfig(configfile)

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

ifnotexist,htmlhelp.html
	fileappend,%htmlhelp%,htmlhelp.html

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

IniRead,allhotkeysonoff,%configfile%,MAIN,HOTKEYS,%A_Space%
if allhotkeysonoff !
		allhotkeysonoff=On

if allhotkeysonoff=Off
				{
				Suspend
				Menu,tray, Rename,All Hotkey >OFF<,All Hotkey >ON<
				}
		
;#########################################################################
;#########################################################################

if showstartup=Yes
	{
	fhelp=Your F-Key Definition`n---------------------------------------------------------------------------------------------`nF1=%f1%`nF2=%f2%`nF3=%f3%`nF4=%f4%`nF5=%f5%`nF6=%f6%`nF7=%f7%`nF8=%f8%`n`n
	Progress, m2 b  w860 h350 zh0 c10 CTBlack CWLIME,F-Key-Commander - Press Left Mouse,%fhelp% , ,Arial
	KeyWait, LButton, D 
	Progress,off
	}
return

;#########################################################################
;#########################################################################

MenuHandler:
if A_ThisMenu=Tray
	{
	if A_ThisMenuItem=EXIT
			{
			Progress, m2 b  w160 h60 zh0 c10 CTBlack CWLIME,by by,F-Key-Commander, ,Arial
			sleep,4000
			Exitapp
			}
	if A_ThisMenuItem=Help [ALT & 3]
			run,htmlhelp.html
	if A_ThisMenuItem=Edit config [ALT & 2]
			run notepad.exe key.ini
	if A_ThisMenuItem=Restart [ALT & 4]
			reload
	if A_ThisMenuItem=Watch Mouse [ALT & 1]
			SetTimer, WatchCursor, 150
	if (A_ThisMenuItem=="All Hotkey >OFF<") or (A_ThisMenuItem=="All Hotkey >ON<")
			{
			if allhotkeysonoff=on	
				allhotkeysonoff=off
			Else
				allhotkeysonoff=on
			
			if allhotkeysonoff=on
				{
				Suspend,off
				Menu,tray, Rename,All Hotkey >ON<,All Hotkey >OFF<
				}
			Else
				{
				Suspend,on
				Menu,tray, Rename,All Hotkey >OFF<,All Hotkey >ON<
				}
			}
	}
Return
;#########################################################################
;# RETURN HIOTKEY'S ######################################################
;#########################################################################
~*return::
Suspend
Critical
SetBatchLines, -1
WinGetActiveTitle,lwint
ControlGetFocus,ga,%wt%
ControlGetText,txt,%ga%,%wt%
lastin:=txt
lastga:=ga
lastwi:=lwint

	;-ENTER & RETURN HOTKEY's-------------
	if goenter
		CheckString(goenter)
	;-------------------------------------
Suspend
return
;#########################################################################
;# TAB HIOTKEY'S #########################################################
;#########################################################################
~*tab::
Suspend
Critical
SetBatchLines, -1
WinGetActiveTitle,lwint
ControlGetFocus,ga,%wt%
ControlGetText,txt,%ga%,%wt%
lastin:=txt
lastga:=ga
lastwi:=lwint

	;-TAB HOTKEY'S------------------------
	if gotab
		CheckString(gotab)
	;-------------------------------------
Suspend
return
;#########################################################################
;#qq1 - qq8 HOTKEY'S #####################################################
;#########################################################################
:c*:qq1::
:c*:qq2::
:c*:qq3::
:c*:qq4::
:c*:qq5::
:c*:qq6::
:c*:qq7::
:c*:qq8::
	;--------------------------------------
	qqtext=%A_ThisHotkey%
	nr:=substr(qqtext,7,4)
	qqkey:=qq%nr%
	;-------------------------------------
	if (regexmatch(qqkey,"i)((.*?)\s*\[\[(.*?)\]\])",iw))
			{
			ok:=CheckString(qqkey)
			if (ok==true)
				return
			}
	;-------------------------------------
	
	if (regexmatch(qqkey,rexcommands,go))
		{
		runfk(ff)
		return
		}
	Else
		{
		if qqkey
			{
			sendinput,%qqkey%
			}
		}

return

;#########################################################################
;#F1 - F8 HOTKEY'S #######################################################
;#########################################################################
F1::
F2::
F3::
F4::
F5::
F6::
F7::
F8::
	;-------------------------------------
	sleep,50
	key=%A_ThisHotkey%
	comgo:=%key%
	lwint=
	;-------------------------------------
	
	if (regexmatch(comgo,"i)((.*?)\s*\[\[(.*?))\]\]",iw))
			{
			ok:=CheckString(comgo)
			if (ok==false)
				{
				Suspend
				send,{%key%}
				Suspend	
				}
			Return
			}

	;-------------------------------------
	
	if runmode=all
		{
		if (regexmatch(comgo,rexcommands,go))
			{
			runfk(comgo)
			return
			}	
		Else
			{
			Suspend
			send,{%key%}
			Suspend	
			}
		}

return
;#########################################################################
;#########################################################################
CheckString(str)
{
Critical
loop
		{
		if (regexmatch(str,"i)((.*?)\s*\[\[(.*?)\]\])",iw))
			{
			WinGetActiveTitle,lwint
			WinGet, active_pid, PID, A
			WinGet,exe,ProcessName,%lwint%
			ifinstring,exe,%iw2% ; wenn exe gesucht ist
				{
				if iw3
					{	
					runfk(iw3)
					return true
					}
				}
		
			ifinstring,lwint,%iw2% ; wenn Fenster gesucht ist
				{
				if iw3
					{	
					runfk(iw3)
					return true
					}
				}
			Stringreplace,str,str,%iw1%,,
			}
		else
		   return false
		
		}
	return false
}
;#########################################################################
;#########################################################################
runfk(co)
{
global
StringSplit,ff,co,;
Loop %ff0%
	{
	comm1=
	comm2=
	comm3=
	comm4=
	comm5=
	comm6=
	run := ff%A_index%
	regexmatch(run,rexcommands,go)
	StringSplit, comm,go2,`,,
	;#################################################################
	if go1=IfexeBreak
		{
		comm2:=lastwin("")
		WinGet,exe,ProcessName,%comm2%
		ifinstring,exe,%comm1%
			{
			break
			}
		}
	;#################################################################
	if go1=Suspend
		{
		Suspend
		if allhotkeysonoff=on	
				allhotkeysonoff=off
			Else
				allhotkeysonoff=on
			
			if allhotkeysonoff=on
				{
				Suspend,off
				Menu,tray, Rename,All Hotkey >ON<,All Hotkey >OFF<
				}
			Else
				{
				Suspend,on
				Menu,tray, Rename,All Hotkey >OFF<,All Hotkey >ON<
				}
		Progress, m2 b  w160 h60 zh0 c10 CTBlack CWLIME,%allhotkeysonoff%,Hotkey's, ,Arial
		sleep,1000
		Progress, off
		}
	;#################################################################
	if go1=WinMin
		{
		go2:=lastwin(go2)
		WinMinimize,%go2%
		}
	;#################################################################
	if go1=WinRestore
		{
		go2:=lastwin(go2)
		WinRestore,%go2%
		}
	;#################################################################
	if go1=WinGetActiveTitle
		{
		WinGetActiveTitle,user
		}
	;#################################################################
	if go1=WinSetTitle
		{
		comm1:=lastwin(comm1)
		comm2:=getvar(comm2)
		WinSetTitle,%comm1%,,%comm2%
		}
	;#################################################################
	if go1=ControlMove
		{
		comm6:=lastwin(comm6)
		ControlMove,%comm1%,%comm2%,%comm3%,%comm4%,%comm5%,%comm6%
		}
	;#################################################################
	if go1=LoadNewConfig
		{
			ifexist,%go2%
			{
			configfile=%go2%
			loadconfig(configfile)
			fhelp=Your F-Key Definition`n---------------------------------------------------------------------------------------------`nF1=%f1%`nF2=%f2%`nF3=%f3%`nF4=%f4%`nF5=%f5%`nF6=%f6%`nF7=%f7%`nF8=%f8%`n`n
			Progress, m2 b  w860 h250 zh0 c10 CTBlack CWLIME,F-Key-Commander New Config was loaded - Press Left Mouse,%fhelp% , ,Arial
			KeyWait, LButton, D 
			Progress,off
			break
			}			
		}
	;#################################################################
	if go1=replace
		{
		Stringreplace,user,user,%comm1%,%comm2%,all
		user:=getvar(user)
		}
	;#################################################################
	if go1=adduser
		{
		go2:=getvar(go2)
		user=%user%%go2%
		user:=getvar(user)
		}
	;#################################################################
	if go1=addchr
		{
		user:=getvar(user)
		ch:=chr(comm1)
		user=%user%%ch%
		}
	;#################################################################
	if go1=setvar
		{
		comm1:=getvar(comm1)
		%comm1%=%comm2%
		}
	;#################################################################
	if go1=addfile
		{
		comm1:=getvar(comm1)
		FileAppend,%comm1%,%comm2%
		}
	;#################################################################
	if go1=sleep
		sleep,%go2%
	;#################################################################
	if go1=If 
		{
		comm2:=getvar(comm2)
		comm1:=getvar(comm1)
		user:=getvar(user)
		if user=%comm1%	
			user=%comm2%
		}
	;#################################################################
	if go1=GetText
		{
		comm2:=lastwin(comm2)
		ControlGetText,user,%comm1%,%comm2%
		}
	;#################################################################
	if go1=WaitWindow
		{
		found:=
		comm1:=lastwin(comm1)	; WindowName
		comm2:=getvar(comm2)	; Wait Time
		if comm2 !
			comm2:=200
		WinGet, id, List
		Loop, %id%
			{
			sleep,100
			if a_index=%comm2%
				return
			sthis_id := id%A_Index%
			WinGetTitle,sthis_title, ahk_id %sthis_id%
			ifinstring,sthis_title,%comm1%
				{
					found:=ok
					break
				}
			}
		if found !
			return
		}
	;#################################################################
	if go1=IfNotTextBreak
		{
		comm2:=lastwin(comm2)
		ControlGetText,zzz,%comm1%,%comm2%
		ifnotinstring,zzz,%comm3%
			{
			break
			}
		}
	;#################################################################
	if go1=WinMove
		{
		comm1:=lastwin(comm1)
		WinMove,%comm1%,,%comm2%,%comm3%,%comm4%,%comm5%
		}
	;#################################################################
	if go1=SetClipboard
		{
		go2:=GetVar(go2)
		clipboard=%go2%
		}
	;#################################################################
	if go1=PasteClipboard
				send,%clipboard%
	;#################################################################
	if go1=Exit
			{
			Progress, m2 b  w160 h60 zh0 c10 CTBlack CWLIME,by by,F-Key-Commander, ,Arial
			sleep,2000
			Exitapp
			}
	;#################################################################
	if go1=CopyClipboard
		{
		send,^c
		ClipWait 2
		}
	;#################################################################
	if go1=window
		{
		go2:=lastwin(go2)
		IfWinNotExist,%go2%
			{
			break
			}
		WinActivate,%go2%
		sleep,10
		}
	;#################################################################
	if go1=winact
		{
		go2:=getvar(go2)
		WinActivate,%go2%
		sleep,50
		}
	;#################################################################
	if go1=msgbox
		{
		go2:=getvar(go2)
		msgbox,64,,%go2%
		}
	;#################################################################
	if go1=mc
		{
		MouseClick,left,%comm1%,%comm2%
		sleep,20
		}
	;#################################################################
	if go1=input
		{
		comm1:=getvar(comm1)
		comm2:=getvar(comm2)
		comm3:=getvar(comm3)
		go2:=getvar(go2)	
		if comm2
			{
			InputBox,user,Text,%comm1%,,,,%comm2%,%comm3%
			if ErrorLevel
				break
			
			user:=getvar(user)
			if user !
				break
			}
		else
			{
			InputBox,user, Text,%go2%,
			
			if ErrorLevel
				break

			user:=getvar(user)
			if user !
				break
			}
		}
	;#################################################################
	if go1=focus
		{
		comm2:=lastwin(comm2)
		ControlFocus,%comm1%,%comm2%
		}
	;#################################################################
	if go1=sendcontrol
		{
		comm2:=getvar(comm2)
		comm3:=lastwin(comm3)
		ControlSend,%comm1%,%comm2%,%comm3%
		
		}
	;#################################################################
	if go1=ControlClick
		{
		comm2:=lastwin(comm2)
		ControlClick,%comm1%,%comm2%
		}
	;#################################################################
	if go1=SetText
		{
		comm2:=getvar(comm2)
		comm3:=lastwin(comm3)
		ControlSetText,%comm1%,%comm2%,%comm3%
		}
	;#################################################################
	if go1=Beep
		SoundBeep,%go2%,100
	;#################################################################
	if go1=send
		{
			go2:=getvar(go2)
			send,%go2%
		}
	;#################################################################
	if go1=sendinput
		{
			go2:=getvar(go2)
			sendinput,%go2%
		}
	;#################################################################
	if go1=senduser
		{
			user:=getvar(user)
			send,%user%
		}
	;#################################################################
	if go1=clrgadget
		{
			comm2:=lastwin(comm2)
			ControlSetText,%comm1%,,%comm2%
		}
	;#################################################################
	if go1=APP
		{
			TRY
				Run,%comm1%,%comm2%,,PID
			Catch e
				run,%comm1%,,,PID
		}

	;#################################################################
	if go1=CLOSEAPP
		{
			if pid 
				{
			  	Process, Close,%pid%
				pid=
				}
		}
	;#################################################################
	if go1=Convert
			user:=getvar(user)
	
	;#################################################################
	if go1=info
		{
		if WinExist("F-KEY-COMMANDER-INFO-WINDOW")
			{
			settimer,infooff,off	 
			Gui,3: Destroy
			}
		tt:=comm1
		if tt !
			{
			Gui,3: Destroy
			settimer,infooff,off
			break	
			}
		Else
		{	
			xx:=comm2
			yy:=comm2

			if xx=left
				xx:=10
			else if xx=right
				xx:=A_ScreenWidth-230
			else if xx !
				xx:=10
			
			if yy=up
				yy:=10
			else if yy=down
				yy:=A_ScreenHeight-80
			else if yy !
				yy:=10
			
			
			tt:=StrWrap(tt,20)
			Gui,3: +LastFound  
			gui,3: color,green,blue
			Gui,3:  +Border -Caption +AlwaysOnTop +ToolWindow -SysMenu +Owner -resize 
			gui,3: font,S14
			gui,3: margin,0,0
			gui,3: add,text,cwhite r3 H70 w220 center, %tt%
			gui,3: show,x%xx% y%yy%w220 h70,F-KEY-COMMANDER-INFO-WINDOW
			settimer,infooff,-13000
			}
		}

	}
return
}
;#########################################################################
;#########################################################################
infooff:
	Gui,3: Destroy
	settimer,infooff,off
	return	

;#########################################################################
;#########################################################################

!1::
watchccursor:
SetTimer, WatchCursor, 150
return
!4::reload
!2::run notepad.exe key.ini
!3::run,htmlhelp.html

;#########################################################################
;#########################################################################

WatchCursor:
MouseGetPos,mx ,my , id, control
WinGetTitle, title, ahk_id %id%
WinGetClass, class, ahk_id %id%
ControlGetPos,cx,cy,cw,ch,%Control%,ahk_id %id%
WinGetPos,xw,yw,ww,wh,%title%
ControlGetText,zz,%control%,%title%
ttstr=
(
ahk_id 	%id% - 
ahk_class    %class%
%title%
%Control%    %cx%     %cy%     %cw%     %ch%
%zz%
Window : %xw%     %yw%     %ww%     %wh%
Mouse  : %mx%     %my% 
)
ToolTip, %ttstr%
GetKeyState, state2,Lbutton,T
    if state2 = U  ; The key has been released, so break out of the loop.
	{
	SetTimer, WatchCursor, off
	clipboard=%ttstr%
	ToolTip
	}
return
;#########################################################################
;#########################################################################
;nur für mich
;!0::
;id=WindowsForms10.STATIC.app.0.2cca100_r43_ad123
;WinGetActiveTitle,wt
;ControlMove,%ID%,,,120,,%wt%
;id=WindowsForms10.STATIC.app.0.2cca100_r43_ad117
;ControlMove,%ID%,,,120,,%wt%
;return
;#########################################################################
;#########################################################################

lastwin(win)
{
; Get Window liste
winlist=
	if win !
		{
		WinGetActiveTitle,wt
		return wt
		}

WinGet, id, List
Loop, %id%
	{
		this_id := id%A_Index%
		WinGetTitle,this_title, ahk_id %this_id%
		ifinstring,this_title,%win%
				{
					win:=this_title
					return win
				}
	}
	return win

}
;#########################################################################
;#########################################################################
getvar(getvar_str)
{
	global	
   	Loop
	{
      __ma:=RegExMatch(getvar_str,"\`%(\w*)\`%",__var)
     if __ma
	 	{
     		if __var1
               	{
                  __var1=%__var1%
                  __dest:=%__var1%
	 			}
        	else
           		__Dest:=
      	
			Stringreplace,getvar_str,getvar_str,`%%__var1%`%,%__dest%
     	}
		else
        	break
	}
	Stringreplace,getvar_str,getvar_str,\LF,`n,all
	Stringreplace,getvar_str,getvar_str,\CR,`r,all
	Stringreplace,getvar_str,getvar_str,\T,`t,all
	Stringreplace,getvar_str,getvar_str,\SPACE,%A_space%,all
	return getvar_str
}
;#########################################################################
;#########################################################################
; StrWarp from Autohotkey Forum
StrWrap(vText, vMaxLen, vNeedle:=" ", vSep:="`r`n")
{
	local
	static vIsV1 := InStr(1, 1,, 0)
	vOutput := ""
	VarSetCapacity(vOutput, StrLen(vText)*2*2)
	vLenNeedle := StrLen(vNeedle)
	Loop
	{
		vLen := StrLen(vText)
		if (vLen <= vMaxLen)
			return vOutput vText
		if (vLen <= vMaxLen + vLenNeedle)
			vPos := InStr(vText, vNeedle, 1, -1 + vIsV1)
		else
			vPos := InStr(vText, vNeedle, 1, vMaxLen + vLenNeedle - vLen - 1 + vIsV1)
		if !vPos
			vPos := InStr(vText, vNeedle, 1, vMaxLen + 1)
		if !vPos
			return vOutput vText
		vOutput .= SubStr(vText, 1, vPos-1) vSep
		vText := SubStr(vText, vPos+vLenNeedle)
	}
}
;#########################################################################
;#########################################################################

loadconfig(configfile)
{
global
; 8 qq-Hotkey qq1-qq8
loop,8
	IniRead,qq%A_index%,%configfile%,QQ,qq%A_index%,%A_Space%

;---------------------------------------------------------------------------------
; 8 return hotKey enter_1 - enter_8
loop,8
	IniRead,enter_%a_index%,%configfile%,ENTER,enter_%A_index%,%A_Space%

goenter=%enter_1%%enter_2%%enter_3%%enter_4%%enter_5%%enter_6%%enter_7%%enter_8%

;---------------------------------------------------------------------------------
; 8 tab hotKey tab_1 - tab_8
loop,8
	IniRead,tab_%A_index%,%configfile%,TAB,tab_%A_index%,%A_Space%

gotab=%tab_1%%tab_2%%tab_3%%tab_4%%tab_5%%tab_6%%tab_7%%tab_8%

;---------------------------------------------------------------------------------
; F1-F8 hotKey je F-Taste Fx_1 - Fx_8
loop,8
	{
	IniRead,F%A_index%,%configfile%,MAIN,F%A_index%,%A_Space%
	IniRead,F1_%A_index%,%configfile%,MAIN,F1_%A_index%,%A_Space%
	IniRead,F2_%A_index%,%configfile%,MAIN,F2_%A_index%,%A_Space%
	IniRead,F3_%A_index%,%configfile%,MAIN,F3_%A_index%,%A_Space%
	IniRead,F4_%A_index%,%configfile%,MAIN,F4_%A_index%,%A_Space%
	IniRead,F5_%A_index%,%configfile%,MAIN,F5_%A_index%,%A_Space%
	IniRead,F6_%A_index%,%configfile%,MAIN,F6_%A_index%,%A_Space%
	IniRead,F7_%A_index%,%configfile%,MAIN,F7_%A_index%,%A_Space%
	IniRead,F8_%A_index%,%configfile%,MAIN,F8_%A_index%,%A_Space%
	}


F1=%F1%%F1_1%%F1_2%%F1_3%%F1_4%%F1_5%%F1_6%%F1_7%%F1_8%
F2=%F2%%F2_1%%F2_2%%F2_3%%F2_4%%F2_5%%F2_6%%F2_7%%F2_8%
F3=%F3%%F3_1%%F3_2%%F3_3%%F3_4%%F3_5%%F3_6%%F3_7%%F3_8%
F4=%F4%%F4_1%%F4_2%%F4_3%%F4_4%%F4_5%%F4_6%%F4_7%%F4_8%
F5=%F5%%F5_1%%F5_2%%F5_3%%F5_4%%F5_5%%F5_6%%F5_7%%F5_8%
F6=%F6%%F6_1%%F6_2%%F6_3%%F6_4%%F6_5%%F6_6%%F6_7%%F6_8%
F7=%F7%%F7_1%%F7_2%%F7_3%%F7_4%%F7_5%%F7_6%%F7_7%%F7_8%
F8=%F8%%F8_1%%F8_2%%F8_3%%F8_4%%F8_5%%F8_6%%F8_7%%F8_8%

;#########################################################################
;#########################################################################

htmlhelp1=
(
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http www.w3.org /TR/xhtml1/DTD/xhtml1-transitional.dtd"><html  Broken Link for safety xmlns="http www.w3.org /1999/xhtml"><head><meta  Broken Link for safety content="de" http-equiv="Content-Language" /><meta content="text/html; charset=utf-8" http-equiv="Content-Type" /><title>Fkey</title><style type="text/css">.auto-style1 {text-align: center;font-size: xx-large;font-family: "Franklin Gothic Medium", "Arial Narrow", Arial, sans-serif;}.auto-style2 {text-align: left;}.auto-style3 {font-family: "Franklin Gothic Medium", "Arial Narrow", Arial, sans-serif;}.auto-style4 {text-align: center;}.auto-style5 {font-family: "Franklin Gothic Medium", "Arial Narrow", Arial, sans-serif;font-size: x-large;}.auto-style6 {font-family: "Franklin Gothic Medium", "Arial Narrow", Arial, sans-serif;font-size: large;}.auto-style7 {font-family: "Franklin Gothic Medium", "Arial Narrow", Arial, sans-serif;font-size: xx-large;}.auto-style8 {font-family: "Franklin Gothic Medium", "Arial Narrow", Arial, sans-serif;color: #000000;}.auto-style9 {color: #C7CC22;}.auto-style10 {font-family: Arial, Helvetica, sans-serif;font-size: medium;}.auto-style11 {text-align: left;font-family: Arial, Helvetica, sans-serif;font-size: medium;}.auto-style12 {font-size: medium;}.auto-style13 {text-align: left;font-family: Arial, Helvetica, sans-serif;}</style></head><body><p class="auto-style1"><strong>Fkey.Commander with qq-Hotkey</strong></p><hr /><p class="auto-style2"><strong><br class="auto-style3" /><span class="auto-style3">F.Key.Commander ist ein kleines Tool um immer wiederkehrende Aufgaben – Eingaben zu erleichtern. In der fkey.ini Datei wird durch Befehle einzelne Funktion für Eine Funktionstasten kann unterschiedliche Funktionen ausführen, abhängig vom Fenster oder Programm. Das Programm wurde in AutoHotkey geschrieben, für mehr Information kann die HelpPage „https://www.autohotkey.com/docs/AutoHotkey.htm“ hilfreich sein. Und für Keystrokes {left} {up}… bitte auf „https://www.autohotkey.com/docs/KeyList.htm“ schauen. Ich verwende den FKey.Commander im Büro da ich bei der Auftragsbearbeitung durch sinvolle Belegungen mir die Tipper und Clickerei sehr erleichtert und Fehlerfreiere eingabe ermöglicht.<br />Vieleicht kann es auch ein Admin für seine Sprosslinge einsetzten.<br />Zun Beispiel kann die qq-Hotkey Funktion für ein immer wieder kehrendes Mit Freundlichen Grüßen eingesetzt werden.<br />Oder um Schnell eine APP zu starten und zu beenden. Mit der "Watch Mouse" funktion, kann ein Button oder Textfeld ausfindig gemacht werden (ALT &amp; 1) (wenn nichts kommt, noch mal Probieren !). </span></strong></p><p class="auto-style13">Programm und SourceCode sind Opensource. Version vom 05.04.2021</p><hr /><p class="auto-style11"><strong>FKey.Commander Hotkeys:</strong></p><p class="auto-style11"><strong>ALT &amp; 1&nbsp;&nbsp;&nbsp; =&nbsp;&nbsp;&nbsp; Watch Mouse ( Mit der Link Mouse Taster über den Button oder Feld Klicken, die Information wird in das Clipboard kopiert)</strong></p><p class="auto-style11"><strong>ALT &amp; 2&nbsp;&nbsp;&nbsp; =&nbsp;&nbsp;&nbsp; Konfiguration</strong></p><p class="auto-style11"><strong>ALT &amp; 3&nbsp;&nbsp;&nbsp;&nbsp; =&nbsp;&nbsp; Hilfe anzeigen</strong></p><p class="auto-style2"><strong><span class="auto-style10">ALT &amp; 4&nbsp;&nbsp;&nbsp; =&nbsp;&nbsp;&nbsp; Programm neu Start&nbsp; </span><span class="auto-style12">&nbsp;&nbsp;</span></strong></p><hr /><p class="auto-style2"><strong><br class="auto-style3" /></strong><span class="auto-style3"><strong>[MAIN]</strong></span><br class="auto-style3" /><span class="auto-style3">F1_1=Notepad.exe[[msgbox(Hello Notepad)]] </span><br class="auto-style3" /><span class="auto-style3">F1_2=word.exe[[Input(You Name is);Msgbox(`%user)]]</span><br class="auto-style3" /><br class="auto-style3" /><span class="auto-style3">Hier wurde für F1 zwei unterschiedliche Funktionen festgelegt.</span><br class="auto-style3" /><br class="auto-style3" /><span class="auto-style3"><strong>[QQ]</strong></span><br class="auto-style3" /><span class="auto-style3">qq1=Msgbox(Du hast qq1 eingegeben)</span><br class="auto-style3" />…<br class="auto-style3" /><span class="auto-style3">qq8=</span><br class="auto-style3" /><span class="auto-style3"><strong>[ENTER]</strong></span><br class="auto-style3" /><span class="auto-style3">ENTER_1=Window/exe[[blabla]]</span><br class="auto-style3" /><span class="auto-style3">..</span><br class="auto-style3" /><span class="auto-style3">ENTER_8 </span><br class="auto-style3" /><span class="auto-style3"><strong>[TAB]</strong></span><br class="auto-style3" /><span class="auto-style3">TAB_1=Window/exe[[blabla]]</span><br class="auto-style3" /><span class="auto-style3">..</span><br class="auto-style3" /><span class="auto-style3">TAB_8 </span><br class="auto-style3" /><br class="auto-style3" /><br class="auto-style3" /><span class="auto-style3"><strong>In der Konfig verwendete Klammerfunktion [[ ... ]]:</strong></span><strong><br class="auto-style3" /></strong><span class="auto-style3"><strong>Programm.exe oder Fenstername [[Funktion;Funktion]]</strong></span><br class="auto-style3" /><br class="auto-style3" /><span class="auto-style3">Fkey.ini</span><br class="auto-style3" /><br class="auto-style3" /><span class="auto-style8"><strong>[MAIN]</strong></span><br class="auto-style8" /><span class="auto-style8">ShowStartup=yes/no</span><br class="auto-style8" /><span class="auto-style8">HOTKEYS=on/off</span><br class="auto-style8" /><span class="auto-style8">RunMode= Window/ALL ... für F1-F8</span><br class="auto-style8" /><br class="auto-style8" /><span class="auto-style8">Wenn die Option „Window“ verwendet wird, werden alle F.Key‘s nur mit dem entsprechendem Fenster oder Programm ausgeführt. Bei der Einstellung „ALL“ kann die K.KEY Funktion immer ausgeführt werden.</span><br class="auto-style8" /><br class="auto-style8" /><span class="auto-style8">Bei Funktionen die ein Fenstername benötigen, kann dieser Weggelassen werden, dann wird das aktive Fenster-Name verwendet. </span><br class="auto-style8" /><br class="auto-style8" /><span class="auto-style8">F1=msgbox(Ich zeige mich immer)</span><br class="auto-style8" /><br class="auto-style8" /><span class="auto-style8">Für die Funktionen können Acht Zeile pro Funktionstaste definiert werden.</span><br class="auto-style8" /><span class="auto-style8">F1=</span><br class="auto-style8" /><span class="auto-style8">F1_1= … F1_8=</span><br class="auto-style8" />…<br class="auto-style8" /><span class="auto-style8">bis F8 ... F8_8=</span></p><div style="color: #d4d4d4;background-color: #1e1e1e;font-family: Consolas, 'Courier New', monospace;font-weight: normal;font-size: 16px;line-height: 22px;white-space: pre;"><div class="auto-style9">Variablen:<br />`%lastin`%&nbsp;&nbsp;&nbsp; =Lester eingebener Text</div><div class="auto-style9">`%lastga`%&nbsp;&nbsp;&nbsp; =Lestztes Gadget </div><div class="auto-style9">`%lastwi`%&nbsp;&nbsp;&nbsp; =Letztet Fenster Name<br />`%user`%&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =User Data</div></div><p class="auto-style2">&nbsp;</p><hr /><p class="auto-style4"><span class="auto-style5">Befehle / Funktion Beschreibung</span></p><p class="auto-style2"><span class="auto-style3"><strong>- Suspend()</strong></span><br class="auto-style3" /><span class="auto-style3">Schalter die Hotkeys an oder aus.</span><br class="auto-style3" /><br class="auto-style3" /><span class="auto-style3"><strong>- Window(Window Name)</strong></span><br class="auto-style3" /><span class="auto-style3">Nachfolgende Befehle werden nur ausgeführt wenn der „Window Name“ mit dem aktuellen Fensternamen übereinstimmt.</span><br class="auto-style3" /><br class="auto-style3" /><span class="auto-style3"><strong>- MC(Xpos,Ypos)</strong></span><br class="auto-style3" /><span class="auto-style3">Simuliert eine Links-Click an der entsprechenden Position.</span><br class="auto-style3" /><br class="auto-style3" /><span class="auto-style3"><strong>- Input(Text,(x,y))</strong></span><br class="auto-style3" /><span class="auto-style3">Öffnet eine Input-Requster für eine Eingabe. Der Text wird in die Variable user gespeichert.</span><br class="auto-style3" /><br class="auto-style3" /><span class="auto-style3"><strong>- Send(Text or. Hotkey)</strong></span><br class="auto-style3" /><span class="auto-style3">Simuliert eine Text Eingabe oder spezielle Tasten.</span><br class="auto-style3" /><span class="auto-style3">Send({right}{tab}{enter})</span><br class="auto-style3" /><br class="auto-style3" /><span class="auto-style3"><strong>- Sleep(Milisenkunden)</strong></span><br class="auto-style3" /><span class="auto-style3">Warte entsprechende Zeit ab. Sleep(1000) = 1s</span></p><p class="auto-style2"><span class="auto-style3"><strong>- AddChar(Nr)</strong></span><br class="auto-style3" /><span class="auto-style3">Fügt der `%user`% Variable ein Zeichen hinzu (1-255). </span><br class="auto-style3" /><br class="auto-style3" /><span class="auto-style3"><strong>- MsgBox(Text)</strong></span><br class="auto-style3" /><span class="auto-style3">Zeigt eine Meldung an. </span><br class="auto-style3" /><span class="auto-style3">Msgbox(Deine eingabe war `%user`%)</span><br class="auto-s
)
htmlhelp2=
(
tyle3" /><br class="auto-style3" /><span class="auto-style3"><strong>- SendControl(Gadget,Key,Window)</strong></span><br class="auto-style3" /><span class="auto-style3">Sendet an ein Gadget eine Tastatureingaben.</span><br class="auto-style3" /><br class="auto-style3" /><span class="auto-style3">-<strong> SetText(Gadget,Text,Window)</strong></span><br class="auto-style3" /><span class="auto-style3">Sendet einen Text an ein Gadget. </span><br class="auto-style3" /><br class="auto-style3" /><span class="auto-style3"><strong>- Beep(Frequenz)</strong></span><br class="auto-style3" /><span class="auto-style3">Erzeugt ein Beep.</span><br class="auto-style3" /><br class="auto-style3" /><span class="auto-style3"><strong>- Senduser()</strong></span><br class="auto-style3" /><span class="auto-style3">Simuliert die Texteingabe für „user“ Variable.</span><br class="auto-style3" /><br class="auto-style3" /><span class="auto-style3"><strong>- WinAct(Window)</strong></span><br class="auto-style3" /><span class="auto-style3">Aktiviert ein Fenster mit dem Fenstername.</span><br class="auto-style3" /><br class="auto-style3" /><span class="auto-style3"><strong>- Focus(Gadget,Window)</strong></span><br class="auto-style3" /><span class="auto-style3">Aktiviert ein Gadget zur Eingabe.</span><br class="auto-style3" /><br class="auto-style3" /><span class="auto-style3"><strong>- SetClipboard(Text)</strong></span><br class="auto-style3" /><span class="auto-style3">Setzt die Zwischenablage mit einem Text.</span><br class="auto-style3" /><br class="auto-style3" /><span class="auto-style3"><strong>- WinMove(x,y,w,h,Window)</strong></span><br class="auto-style3" /><span class="auto-style3">Verschiebt ein Fenster. </span><br class="auto-style3" /><br class="auto-style3" /><span class="auto-style3"><strong>- APP(Programm oder www.)</strong></span><br class="auto-style3" /><span class="auto-style3">Startet ein Programm oder eine Webseite.</span><br class="auto-style3" /><br class="auto-style3" /><span class="auto-style3"><strong>- APP()</strong></span><br class="auto-style3" /><span class="auto-style3">Schließt das gestartet Programm.</span><br class="auto-style3" /><br class="auto-style3" /><span class="auto-style3">-<strong> Exit()</strong></span><br class="auto-style3" /><span class="auto-style3">Beendet F.Key.Commander</span><br class="auto-style3" /><br class="auto-style3" /><span class="auto-style3"><strong>- IF(v1,Value)</strong></span><br class="auto-style3" /><span class="auto-style3">Wenn die „User“ Variable den Wert von v1 hat, dann ändert es den Wert von „Value“.</span><br class="auto-style3" /><br class="auto-style3" /><span class="auto-style3"><strong>- AddFile(Text,Datei)</strong></span><br class="auto-style3" /><span class="auto-style3">Fügt einer Datei einen Text an.</span><br class="auto-style3" /><br class="auto-style3" /><span class="auto-style3"><strong>- Convert()</strong></span><br class="auto-style3" /><span class="auto-style3">Konvertiert die „user“ Variable, falls `%…`% Elemente enthalten sind.</span><br class="auto-style3" /><br class="auto-style3" /><span class="auto-style3"><strong>- AddUser(Text)</strong></span><br class="auto-style3" /><span class="auto-style3">Fügt der Variable „user“ einen Text am Ende hinzu.</span><br class="auto-style3" /><br class="auto-style3" /><span class="auto-style3"><strong>- LoadConfig(Datei)</strong></span><br class="auto-style3" /><span class="auto-style3">Lädt eine komplett neue Konfiguration.</span><br class="auto-style3" /><br class="auto-style3" /><span class="auto-style3"><strong>- ControlClick(Gadget,Window)</strong></span><br class="auto-style3" /><span class="auto-style3">Simuliert eine MauseClick auf eine Gadget.</span><br class="auto-style3" /><br class="auto-style3" /><span class="auto-style3"><strong>- IfexeBreak(notepad.exe)</strong></span><br class="auto-style3" /><span class="auto-style3">Wenn Programm.exe Aktiv ist, dann wird abgebrochen.</span><br class="auto-style3" /><br class="auto-style3" /><span class="auto-style3"><strong>- CllrGadget(Gadget,Window)</strong></span><br class="auto-style3" /><span class="auto-style3">Löscht den Text in einem Gadget.</span><br class="auto-style3" /><br class="auto-style3" /><span class="auto-style3"><strong>- Info(text,x,y)</strong></span><br class="auto-style3" /><span class="auto-style3">Zeigt ein INFO-Fenster,für 10s, mit dem Text an.</span><br class="auto-style3" /><br class="auto-style3" /><span class="auto-style3"><strong>-&nbsp;&nbsp;&nbsp; WinMax(win)</strong></span><strong><br class="auto-style3" /></strong><span class="auto-style3"><strong>-&nbsp;&nbsp;&nbsp; WinMin(win)</strong></span><strong><br class="auto-style3" /></strong><span class="auto-style3"><strong>-&nbsp;&nbsp;&nbsp; WinRestore(win)</strong></span><br class="auto-style3" /><span class="auto-style3">Fenster Klein, Groß und Restore.</span><br class="auto-style3" /><br class="auto-style3" /><span class="auto-style3"><strong>- WinSetTitle(old,new)</strong></span><br class="auto-style3" /><span class="auto-style3">Fenstername umbenennen. </span><br class="auto-style3" /><br class="auto-style3" /><span class="auto-style3"><strong>- WinGetActiveTitle()</strong></span><br class="auto-style3" /><span class="auto-style3">Liest den Aktuellen Fenstername nach „user“ aus.</span><br class="auto-style3" /><br class="auto-style3" /><span class="auto-style3"><strong>- ControlMove(x,y,w,h,Window)</strong></span><br class="auto-style3" /><span class="auto-style3">Verschiebt ein Gadget.</span><br class="auto-style3" /></p><hr /><p class="auto-style2"><span class="auto-style7"><strong>Meine Beispiel Config:</strong></span><strong><br class="auto-style6" /></strong></p><p class="auto-style2"><span class="auto-style6">[MAIN]</span><br class="auto-style6" /><span class="auto-style6">RUNMODE=WINDOW</span><br class="auto-style6" /><span class="auto-style6">SHOWSTARTUP=NO</span><br class="auto-style6" /><span class="auto-style6">F1_1=Syncos Management[[input(PM);MC(582,345);sleep(50);send({bs 5}{del 5});sleep(100);senduser();adduser( - `%a_mday`%.`%a_mon`%\LF);Addfile(`%user`%,Messmittel.txt);]]</span><br class="auto-style6" /><span class="auto-style6">F1_2=DATABASE[[Input(Ident Nr.);adduser({enter};sleep(100);settext(RichEdit20W1,CIM DATABASE,user);focus(RichEdit20W1)]]</span><br class="auto-style6" /><span class="auto-style6">F1_3=(BARB)[[ControlClick(ATL:Edit43,FOSS-BI);input(F-NUmmer);send(`%user`%);sleep(500);send(^n);sleep(500);</span><br class="auto-style6" /><span class="auto-style6">F1_4=ControlClick(ORButton13,FOSS-BI);ControlClick(ATL:Edit11,FOSS-BI)]]</span><br class="auto-style6" /><span class="auto-style6">F1_5=(BAR3)[[ControlClick(ThunderRT6UserControlDC1),BAR3]]</span><br class="auto-style6" /><span class="auto-style6">F1_6=Prüfmittel[[ControlMove(WindowsForms10.STATIC.app.0.2cca100_r43_ad123,28,267,150,29);</span><br class="auto-style6" /><span class="auto-style6">F1_7=ControlMove(WindowsForms10.STATIC.app.0.2cca100_r43_ad117,28,361,160,29);</span></p><p class="auto-style2"><span class="auto-style6">F1_8=gettext(WindowsForms10.EDIT.app.0.2cca100_r43_ad123,Prüfmittel);msgbox(`%user`%);winmove(Prüfmittel,,,518,145)]]</span><br class="auto-style6" /><br class="auto-style6" /><span class="auto-style6">F8=exit()</span><br class="auto-style6" /><span class="auto-style6">[QQ]</span><br class="auto-style6" /><span class="auto-style6">qq9=R:\Messmaschine\APEXS\htmlpic\</span><br class="auto-style6" /><span class="auto-style6">qq3=R:\Messmaschine\QS-Bilder\</span><br class="auto-style6" /><span class="auto-style6">qq1=Gruß Markus{enter}</span><br class="auto-style6" /><span class="auto-style6">qq2=Mit freundlichen Grüßen{enter}Markus</span><br class="auto-style6" /></p><hr /><p class="auto-style2"><span class="auto-style6">[MAIN]</span><br class="auto-style6" /><span class="auto-style6">RUNMODE=ALL</span><br class="auto-style6" /><span class="auto-style6">SHOWSTARTUP=YES<br />F1=APP(notepad.exe)<br />F2=Input(Enter your Name);sleep(500);send(Your Name is `%user`%)<br />F3=WinGetActiveTitle();WinSetTitle(`%user`%,Ein neuer Fester Name...)</span></p><p class="auto-style2">&nbsp;</p><p class="auto-style2">&nbsp;</p></body></html>
)
htmlhelp=%htmlhelp1%%htmlhelp2%
return
}


Last edited by daterone on 18 Apr 2021, 13:07, edited 1 time in total.
just me
Posts: 9407
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: F.Key-Commander Tool

Post by just me » 10 Apr 2021, 04:39

Moin,

willkommen im Club. Wann hast Du das programmiert? Ich sehe nicht viel spezielle AHK 1.1 Syntax.
daterone
Posts: 6
Joined: 08 Mar 2021, 17:00

Re: F.Key-Commander Tool

Post by daterone » 11 Apr 2021, 23:58

Hi,
da ich schon länger mit AHK Programmieren ist da noch sehr viel alter Code... naja...
Funktioniert so aber sehr gut.

Gruß Daterone
Post Reply

Return to “Skripte und Funktionen”