Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 19:26

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Frage] Hotkeyset und Input ?

Discussion on [Frage] Hotkeyset und Input ? within the AutoIt forum part of the Coders Den category.

Reply
 
Old 11/06/2010, 23:49   #16
 
PenGuin :O's Avatar
 
elite*gold: 2
Join Date: Mar 2008
Posts: 1,778
Received Thanks: 1,222
Quote:
Originally Posted by MagicDave View Post
*.* ehhhmm meinstu du ich poste was ohne dass ich was teste?
Ja, hat man schon des Öfteren gesehen.
PenGuin :O is offline  
Old 11/06/2010, 23:51   #17
 
lolkop's Avatar
 
elite*gold: 280
Join Date: May 2007
Posts: 2,818
Received Thanks: 3,483
Quote:
Originally Posted by ~Flow~ View Post
Wie genau mache ich das ?

Könntest du ein beispiel machen ?
Bitte...
ich würde dem user einfach ein fenster geben, in dem er irgend eine taste drücken kann, welche dann als hotkey gespeichert wird.

zb so:
Code:
Dim $keys_old, $keys_new, $sub=-1, $hotkey=-1
$gui = GUICreate('Gui', 200, 50)
$btn = GUICtrlCreateButton('Register Hotkey', 10, 10, 180, 30)
GUISetState()

While 1
	Switch GUIGetMsg()
		Case -3
			Exit
		Case $btn
			If Not WinExists($sub) Then
				$sub = GUICreate('Press Any Key', 50, 50, -1, -1, 0x10C00000)
				$keys_old = GetKeyboardState()
			EndIf
		Case Else
			If WinExists($sub) Then
				$keys_new = GetKeyboardState()
				For $i=0 To 255
					If $keys_old[$i] <> $keys_new[$i] Then
						$hotkey = $i
						TrayTip('Info', 'Hotkey Registred', 1)
						GUIDelete($sub)
						ExitLoop
					EndIf
				Next
			EndIf
			If _IsPressed($hotkey) Then	MsgBox(0, 'Info', 'Der von dir festgelegte HotKey wurde gedrückt')
	EndSwitch
WEnd

Func _IsPressed($key, $dll = 'user32.dll')
	Local $state = DllCall($dll, 'short', 'GetAsyncKeyState', 'int', $key)
	Return BitAND($state[0], 0x8000) <> 0
EndFunc

Func GetKeyboardState($dll = 'User32.dll')
	Local $state, $array[256], $struct = DllStructCreate('byte[256]')
	$state = DllCall($dll, 'int', 'GetKeyboardState', 'ptr', DllStructGetPtr($struct))
	For $i=1 To 256
		$array[$i-1] = BitAND(DllStructGetData($struct, 1, $i), 0x0F)
	Next
	Return $array
EndFunc
lolkop is offline  
Thanks
2 Users
Old 11/07/2010, 19:26   #18
 
elite*gold: 25
Join Date: Mar 2009
Posts: 626
Received Thanks: 485
Quote:
Originally Posted by lolkop View Post
ich würde dem user einfach ein fenster geben, in dem er irgend eine taste drücken kann, welche dann als hotkey gespeichert wird.

zb so:
Code:
Dim $keys_old, $keys_new, $sub=-1, $hotkey=-1
$gui = GUICreate('Gui', 200, 50)
$btn = GUICtrlCreateButton('Register Hotkey', 10, 10, 180, 30)
GUISetState()

While 1
	Switch GUIGetMsg()
		Case -3
			Exit
		Case $btn
			If Not WinExists($sub) Then
				$sub = GUICreate('Press Any Key', 50, 50, -1, -1, 0x10C00000)
				$keys_old = GetKeyboardState()
			EndIf
		Case Else
			If WinExists($sub) Then
				$keys_new = GetKeyboardState()
				For $i=0 To 255
					If $keys_old[$i] <> $keys_new[$i] Then
						$hotkey = $i
						TrayTip('Info', 'Hotkey Registred', 1)
						GUIDelete($sub)
						ExitLoop
					EndIf
				Next
			EndIf
			If _IsPressed($hotkey) Then	MsgBox(0, 'Info', 'Der von dir festgelegte HotKey wurde gedrückt')
	EndSwitch
WEnd

Func _IsPressed($key, $dll = 'user32.dll')
	Local $state = DllCall($dll, 'short', 'GetAsyncKeyState', 'int', $key)
	Return BitAND($state[0], 0x8000) <> 0
EndFunc

Func GetKeyboardState($dll = 'User32.dll')
	Local $state, $array[256], $struct = DllStructCreate('byte[256]')
	$state = DllCall($dll, 'int', 'GetKeyboardState', 'ptr', DllStructGetPtr($struct))
	For $i=1 To 256
		$array[$i-1] = BitAND(DllStructGetData($struct, 1, $i), 0x0F)
	Next
	Return $array
EndFunc
wie baue ich das alles ein,
das es sich erst öffnet wenn ich auf einen bestimmten button gedrückt habe ?
~Flow~ is offline  
Reply


Similar Threads Similar Threads
[Frage] Input Box
10/08/2010 - AutoIt - 22 Replies
Hey E*pvpers. Tut mir Leid aber hier kommt schon meine nächste Frage zur Input Box. Wie kann ich eine Zahl die ich in eine Input Box eintrage weiterbenutzen? Wenn ich zB eine Input Box mache wo man einen Zeitinterwall eingeben soll -> Wie mache ich es, dass mit der Zahl gerechnet wird, die in die Input Box eingegeben wird? Hoffe ihr versteht was ich meine :>
[Frage] AUtoIT HotkeySet aus Eingabefeld auslesen
08/22/2010 - AutoIt - 8 Replies
Hallo Leute Also ich habe da mal eine frage bezüglich den HotkeySet befehl und den eingabefeldern. Nehmen wir an ich will wenn ich mir ein Gui in KODA FormDesigner erstelle ein Start knopf zum starten eines Spammers erstellen. Auf den GUI soll also ein Eingabefeld sein was ausgelesen wird und den HotkeySet Befehlt zugewiesen wird. HotKeySet("", "Start") dieser Befehl soll nun ein Eingabefeld auslesen was z.b. hier drinne steht: $eingabefeld = GUICtrlCreateEdit("", 400, 456, 193, 41)
Hotkeyset
06/03/2010 - AutoIt - 1 Replies
Ich wollte "A" und "S" auf der Tastatur tauschen. Jedoch während dem scripten ist mir aufgefallen, dass wenn ich "A" drücke, geht er zum Hotkeyset und drückt "S". Aber weil ich ja "A" und "S" vertauschen will, wirds ne endlosschleife. Wie kann ich das verändern, dass das gesendene (von AutoIT) nicht zum Hotkeyset geht. HotKeySet("a", "a") HotKeySet("s", "s") While 1
HotKeySet
06/02/2010 - AutoIt - 6 Replies
Wieso klappt das bei mir nicht ? HotKeySet("{F8}" , "Start") HotKeySet("{F9}" , "Ende") Func Start() while 1 xxxx xxx xxx xx x
hotkeyset als input auslesen?
05/13/2010 - AutoIt - 7 Replies
hallo, wie ist es möglich, dass wenn man ein hotkeyset belegt, die taste via input ausgelesen wird? mit guictrlread($input1) funz es i-wie nicht. danke im vorraus! achja, wenn ihr zeit habt, schaut doch mal hier:



All times are GMT +1. The time now is 19:27.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.