Binds anpassen

Post a reply


In an effort to prevent automatic submissions, we require that you complete the following challenge.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :| :mrgreen: :geek: :ugeek: :arrow: :angel: :clap: :crazy: :eh: :lolno: :problem: :shh: :shifty: :sick: :silent: :think: :thumbup: :thumbdown: :salute: :wave: :wtf: :yawn: :facepalm: :bravo: :dance: :beard: :morebeard: :xmas: :HeHe: :trollface: :cookie: :rainbow: :monkeysee: :monkeysay: :happybday: :headwall: :offtopic: :superhappy: :terms: :beer:
View more smilies

BBCode is ON
[img] is OFF
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Binds anpassen

Re: Binds anpassen

Post by gregster » 23 May 2020, 06:45

Vielleicht so eine Grundstruktur:

Code: Select all

; Set default keys
Oldkeys := ["Numpad1", "Numpad2"]
HotKey, IfWinActive, RAGE Multiplayer		; replaces   #IfWinActive, RAGE Multiplayer
for i, key in Oldkeys
	Hotkey, % key, label%i%

; Gui
Gui, Add, Hotkey, x22 w150 vChosenHotkey1, % Oldkeys[1]
Gui, Add, Checkbox, vaddWin1 , mit Win-Modifier
Gui, Add, Hotkey, x22 w150 vChosenHotkey2, % Oldkeys[2]
Gui, Add, Checkbox, vaddWin2 , mit Win-Modifier
Gui, Add, Button, gUpdateKey, Save
Gui, Show
return

UpdateKey:
Gui, Submit, nohide
loop % Oldkeys.count()				; number of Hotkeys
{
	Hotkey, % Oldkeys[A_index], label%A_index%, Off		; disable previous hotkeys
	if (addWin%A_index% = 1)				; check for win modifier
		ChosenHotkey%A_index% := "#" ChosenHotkey%A_index%
	Hotkey, % "$" ChosenHotkey%A_index%, label%A_index%, On		; set new hotkey
	Oldkeys[A_index] := ChosenHotkey%A_index%		; store hotkey
}
return

label1:
SendInput {t}/duty{enter}
return

label2:
SendInput {t}/s >>LSPD<< Stehenbleiben Sie sind verhaftet{enter}
return
Nur flüchtig getestet, aber ist erweiterbar für weitere Tastenkombos und Features.

Mit IniWrite und IniRead könntest du das Ganze dann noch in einer ini-Datei für die Nachwelt (oder die nächste Spielrunde) speichern.

Re: Binds anpassen

Post by Ioannis20x » 23 May 2020, 03:29

und sry vorhin für 2 mal das gleich posten ich habe die Nachricht auf der stand dass es noch 2 Minuten braucht nicht gelesen :D

Re: Binds anpassen

Post by Ioannis20x » 23 May 2020, 03:26

Code: Select all

#IfWinActive, RAGE Multiplayer
Gui, Show, x30 y40 h610 w960, Rarebinder
#UseHook
Gui, Font, S10 Cgrey, Arial
Gui, Add, Picture, x0 y0 h610 w960, rare_logo.png
Gui, Add, Edit, x10 y10 w500 h20 ReadOnly, Herzlich Willkommen im Rarebinder. Wir wünschen dir viel Spaß auf Rare-V
Gui, Add, Button, x22 y60 w140 h30 gTestfunktionsname, Beenden
Gui, Add, Button, x22 y30 w140 h30 gStartSAMP, auf Rare-V verbinden
Gui, Add, Hotkey, x22 y80 w140 h30 vChosenHotkey
return



vChosenHotkey:





Testfunktionsname:
msgbox,4,Beenden, Sind Sie sicher, dass Sie den Beenden wollen?
IfMsgBox Yes
2GUIclose:
ExitApp
return

StartSAMP:
Run, updater.exe, C:\RAGEMP


NumpadDiv::
SendInput {t}/duty{enter}
return

Numpad3::
SendInput {t}/s >>LSPD<< Stehenbleiben Sie sind verhaftet{enter}
return


NumpadMult::
SendInput {t}/s >>LSPD<< Stehenbleiben Sie sind verhaftet{enter}
return


F6::
FormatTime,Uhrzeit, HH:mm:ss
SendInput {t}/me schaut auf die Uhrzeit. (%Uhrzeit%) {Enter}
return

Del::
Suspend
return

NumpadSub::
SendInput {t}3{enter}
sleep 1000
SendInput {t}2{enter}
sleep 1000
SendInput {t}1{enter}
sleep 1000
SendInput tDer Countdown ist zuende{!}{enter}
return

^::
SendInput {t}/afk{enter}
return
[Mod edit: Codebox gefixt.]

Re: Binds anpassen

Post by gregster » 23 May 2020, 03:06

Das oben erwähnte Hotkey-GUI-Element ist bereits ein Edit-Feld, spezialisiert auf die Erstellung von Tastenkombinationen.

Hast du mal reingeguckt in den Link? Hier auch auf deutsch: https://ahkde.github.io/docs/commands/GuiControls.htm#Hotkey

Edit: Ah so, inzwischen hast du nochmal gepostet... am besten zeigst du mal deinen bisherigen Code.

Re: Binds anpassen

Post by Ioannis20x » 23 May 2020, 03:04

gregster wrote:
23 May 2020, 02:42
Es gibt ein Hotkey-GUI-Element: https://www.autohotkey.com/docs/commands/GuiControls.htm#Hotkey
Aber es ist etwas limitiert:
The Hotkey control has limited capabilities. For example, it does not support mouse/joystick hotkeys or the Win key (LWin and RWin). One way to work around this is to provide one or more checkboxes as a means for the user to enable extra modifiers such as the Win key.
- ich glaube es gibt auch benutzererstellte Bibliotheken für sowas... :think:

Vielleicht hilft auch das : https://www.autohotkey.com/boards/viewtopic.php?t=38651#p177277
Danke für deine schnelle Antwort. Ich habe jetzt deinen oberen Vorschlag übernommen und der funktionniert auch.
Allerdings weiß ich nicht wie ich noch ein Textfeld hinzufüge welches mit dem Anderen reagiert und es dann noch abspeichern damit der Hotkey nicht gelöscht wird.

Re: Binds anpassen

Post by Ioannis20x » 23 May 2020, 03:01

gregster wrote:
23 May 2020, 02:42
Es gibt ein Hotkey-GUI-Element: https://www.autohotkey.com/docs/commands/GuiControls.htm#Hotkey
Aber es ist etwas limitiert:
The Hotkey control has limited capabilities. For example, it does not support mouse/joystick hotkeys or the Win key (LWin and RWin). One way to work around this is to provide one or more checkboxes as a means for the user to enable extra modifiers such as the Win key.
- ich glaube es gibt auch benutzererstellte Bibliotheken für sowas... :think:

Vielleicht hilft auch das : https://www.autohotkey.com/boards/viewtopic.php?t=38651#p177277
Danke für deine schnelle Antwort. Allerdings weiß ich nicht wie ich noch ein Textfeld erstelle was mit dem Hotkey zusammenhängt. :?:

Re: Binds anpassen

Post by gregster » 23 May 2020, 02:42

Es gibt ein Hotkey-GUI-Element: https://www.autohotkey.com/docs/commands/GuiControls.htm#Hotkey
Aber es ist etwas limitiert:
The Hotkey control has limited capabilities. For example, it does not support mouse/joystick hotkeys or the Win key (LWin and RWin). One way to work around this is to provide one or more checkboxes as a means for the user to enable extra modifiers such as the Win key.
- ich glaube es gibt auch benutzererstellte Bibliotheken für sowas... :think:

Vielleicht hilft auch das : https://www.autohotkey.com/boards/viewtopic.php?t=38651#p177277

Binds anpassen

Post by Ioannis20x » 23 May 2020, 02:35

Moin,
ich versuche seit Tagen einen Binder für mich und meine Freunde zu erstellen.
Allerdings haben wir alle einen anderen Geschmack, was Binds angeht.
Meine Frage wäre jetzt:
Wie kann ich meine Binds duch ein Textfeld einstellen und speichern?

Habe auch ein Beispiel gefunden welches meinen Vorstellungen entspricht:
https://ibb.co/QXZ1TBY

Top