6105 Posted November 30, 2010 Share Posted November 30, 2010 How i can know what key is pressed? I can know what key is pressed more easy? now i know just 1 metod: HotKeySet("a", "a") HotKeySet("b", "b") HotKeySet("c", "c") HotKeySet("d", "d") Func a() MsgBox(0,'','is pressed a') EndFunc ;==>a Func b() MsgBox(0,'','is pressed b') EndFunc ;==>b Func c() MsgBox(0,'','is pressed c') EndFunc ;==>c Func d() MsgBox(0,'','is pressed d') EndFunc ;==>d Thanks. [center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Don't utter a single word[/font][/center][center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Just shut your pretty mouth[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you again[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you[/font][/center][center][font=courier new,courier,monospace]In hell[/font][/center] Link to comment Share on other sites More sharing options...
PsaltyDS Posted November 30, 2010 Share Posted November 30, 2010 You can use the same handler function for more than one key and the @HotKeyPressed macro will indicate which key it was: HotKeySet("a", "_Button") HotKeySet("b", "_Button") HotKeySet("c", "_Button") HotKeySet("{ESC}", "_Quit") While 1 Sleep(10) WEnd Func _Button() Local $sKey = @HotKeyPressed MsgBox(0,'','is pressed ' & $sKey, 2) EndFunc ;==>a Func _Quit() Exit EndFunc ;==>d Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
ZacUSNYR Posted November 30, 2010 Share Posted November 30, 2010 _IsPressed Link to comment Share on other sites More sharing options...
Realm Posted November 30, 2010 Share Posted November 30, 2010 Hello toader, Maybe _IsPressed() is what you are looking for? Realm My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry. Link to comment Share on other sites More sharing options...
6105 Posted November 30, 2010 Author Share Posted November 30, 2010 (edited) Realm. for every presed symbol to write function with _isPressed will be long and hard for procesor.. If _IsPressed("23", $dll) Then MsgBox(0,"_IsPressed", "End Key Pressed") ExitLoop EndIf now the best is with hotkeys with 4 lines of function and +1 line for every hotkey Func _Button() Local $sKey = @HotKeyPressed MsgBox(0,'','is pressed ' & $sKey, 2) EndFunc ;==>a Thank you PsaltyDS . Edited November 30, 2010 by toader [center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Don't utter a single word[/font][/center][center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Just shut your pretty mouth[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you again[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you[/font][/center][center][font=courier new,courier,monospace]In hell[/font][/center] Link to comment Share on other sites More sharing options...
bogQ Posted November 30, 2010 Share Posted November 30, 2010 Before i reported thread about 30 minutes ago (before editing or deliting) i so a almost functional keyloger, there isnt anything hard for cpu on _IsPressed if then one isnt makeing keyloger. TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now