Altometer Posted July 6, 2010 Share Posted July 6, 2010 (edited) Hello everyone, I am attempting to code something similar to the old familiar bios wake on password feature. What I am aiming to do is run a function after entering a "SERIES" of keys and not a COMBINATION of them. for instance, If I type "a b c" and have notepad come up. OR even CTRL+(a b c) What I have tried so far is this, HotKeySet('q'&'w'&'e'&'r'&'t'&'y','_notepadlaunch') however this makes the hotkey only responsive to the q key. The next thing is the _IsPressed() command leading me to the idea, #Include <Misc.au3> HotKeySet('^q','_off');to close the program(faster than right clicking start menu in w7) dim $A_pressed=0 dim $B_pressed=0 dim $C_pressed=0 MsgBox(0,"","on",1) while 1 if _IsPressed('41') Then $A_pressed=1 if _IsPressed('42') & $A_pressed=1 Then $B_pressed=1 if _IsPressed('43') & $A_pressed=1 & $B_pressed=1 Then ShellExecute('notepad.exe') sleep(10) ;prevents 100% cpu WEnd Func _off() MsgBox(0,"",'off',1) Exit 0 EndFunc ;_off I am pretty sure the _ispressed idea is the right one, except I am hitting a wall. Unfortunately because of the difficult to describe manor of this problem, a Google search did me no good. anyone have any ideas? thanks! Edited July 13, 2010 by Altometer Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 6, 2010 Moderators Share Posted July 6, 2010 Altometer, Very rough and ready, but it might give you some ideas: #include <GUIConstantsEx.au3> $sCode = "qwerty" $hGUI = GUICreate("Test", 500, 500) $hInput = GUICtrlCreateInput("", 10, 10, 100, 20) GUISetState(@SW_SHOW) $iCount = 1 While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch If GUICtrlRead($hInput) = StringMid($sCode, 1, $iCount) Then $iCount += 1 If $iCount > StringLen($sCode) Then MsgBox(0, "Hit", "You entered the code") GUICtrlSetData($hInput, "") $iCount = 1 EndIf Else If StringLen(GUICtrlRead($hInput)) = $iCount Then GUICtrlSetData($hInput, "") EndIf WEnd M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
PsaltyDS Posted July 6, 2010 Share Posted July 6, 2010 The same hooking techniques that would make a "hot phrase" work would make a key logger, so we don't discuss that here. Not required anyway, since a single hot key could pop a menu from which a single additional keystroke could pick an option, i.e. ^m followed by 1 does one thing, and ^m followed by 2 does something else. 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...
AdmiralAlkex Posted July 6, 2010 Share Posted July 6, 2010 Actually the example for _WinAPI_SetWindowsHookEx() does exactly this, if anyone is interested (look in helpfile). .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
Altometer Posted July 13, 2010 Author Share Posted July 13, 2010 this is not for a key logger, it is to be used as a way to open a gui to all of my nsfw files and folders that I have a separate script auto hiding them. key loggers are so ridiculously easy that I don't care that they can't be discussed here. Anyone that needs help making one in this language should be shot. Melba, that is certainly heading into the right direction, I could set the input box in the gui to only open with a hotkey and then make the password work... Admiral while I do appreciate the reply, _WinAPI_SetWindowsHookEx is just a bit above my level of coding knowledge I am marking this topic as "solved" because Melba's solution is viable and this doesn't to be such common knowledge. 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