Jump to content
Sign in to follow this  
Altometer

SOLVED:Password triggered gui or function action

Recommended Posts

Altometer

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 by Altometer

Share this post


Link to post
Share on other sites
Melba23

Altometer,

Very rough and ready, but it might give you some ideas: :blink:

#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._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
PsaltyDS

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.

:blink:


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

Share this post


Link to post
Share on other sites
Altometer

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 :blink: I am marking this topic as "solved" because Melba's solution is viable and this doesn't to be such common knowledge.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×