Sign in to follow this  
Followers 0
sjorrel

get key pressed?

15 posts in this topic

I know that you can use _IsPressed() to determine if a particular key has been pressed, but is there a function to determine what key is currently being pressed?

Share this post


Link to post
Share on other sites



While 1
    
    If _IsPressed(11) Then; the control key is #11
        While _IsPressed(11)
            Beep(1000, 100)
        WEnd
    EndIf
WEnd


Func _IsPressed($hexKey)
    Local $aR, $bO
    
    $hexKey = '0x' & $hexKey
    $aR = DllCall("user32", "int", "GetAsyncKeyState", "int", $hexKey)
    If Not @error And BitAND($aR[0], 0x8000) = 0x8000 Then
        $bO = 1
    Else
        $bO = 0
    EndIf
    
    Return $bO
EndFunc  ;==>_IsPressed

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Hmm thanks for the reply, but I already know about _IsPressed(). Maybe I'm being a bit thick, but doesn't that script just beep if the control key is pressed?

I want a function that will return what key is being pressed, not check for one key in particular.

Share this post


Link to post
Share on other sites

Hmm thanks for the reply, but I already know about _IsPressed(). Maybe I'm being a bit thick, but doesn't that script just beep if the control key is pressed?

I want a function that will return what key is being pressed, not check for one key in particular.

What is this for?


AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)

Share this post


Link to post
Share on other sites

What is this for?

On another forum I visit somebody was asking if there was any typewriter style software that would force them to write better - i.e. only allowing you to type characters, shift, space and not deleting or using special characters. Something similar to Blockwriter on the Mac.

I was trying to come up with something, and I was hoping to create a read-only edit box. I want to know if theres a way of getting the value of a key pressed which could then be checked to see if it is 'typewriter valid', play a sound and add it to the edit box.

No, not a keylogger, if that's what you're thinking!

Share this post


Link to post
Share on other sites

No, not a keylogger, if that's what you're thinking!

Technically, it logs keys, therefore it is a key-logger, the question is whether or not it is a malicious one, post your code, and you'll probably get more help

Share this post


Link to post
Share on other sites

Technically, it logs keys, therefore it is a key-logger, the question is whether or not it is a malicious one, post your code, and you'll probably get more help

That's a silly thing to say. Are you saying any GUI control that accepts text entry is a 'key logger'?

Share this post


Link to post
Share on other sites

How about...

HotKeySet("{BACKSPACE}", "_DoNothing")
HotKeySet("{LEFT}", "_DoNothing")
HotKeySet("{RIGHT}", "_DoNothing")
; etc...

; ... GUI Code ...

Func _DoNothing()
    Beep()
EndFunc   ;==>_DoNothing


[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

Share this post


Link to post
Share on other sites

That's a silly thing to say. Are you saying any GUI control that accepts text entry is a 'key logger'?

Only the ones that record them :D .... Keyloggers can be useful in debugging, can be useful in alot of things, but maliciousness over the past has ruined this forum to determine the "good" from the "bad". Publicly post for the "good" and the "bad" will find it anyway.

I'm sure it's nothing against you personally, It's just you won't find much help on that subject or "related" subjects that could be turned into said subject (Damn that was confusing).


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

So if i buy a cd burner and burn songs i bought and "legally" own to disk so i can play the songs in my car while i drive to work i guess thats illegal and i should go to prison..

maybe we should emphasize what keylogging means

Keylogger: A computer program that captures the keystrokes of a computer user and stores them. Modern keyloggers can store additional information, such as images of the user’s screen. Most malicious keyloggers send this data to a third party remotely (such as via email).

Keylogger:Keystroke logging is a diagnostic used in software development that captures the user's keystrokes. It can be useful to determine sources of error in computer systems. Such systems are also highly useful for law enforcement and espionage – for instance, providing a means to obtain passwords or encryption keys and thus bypassing other security measures.

Edited by Wacksoff

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

BOREDOM

#include <GUIConstants.au3>
Global $cheat = 0
Global $m[5]
$m[0] = "ttttttuhhhhhh type it yoooo"
$m[1] = "tttttttypeee it"
$m[2] = "donnnnnt type it"
$m[3] = "eeeeeee cat in the crat smat"
$m[4] = "lil boy bue and duh mans in the spoon?"
$GUI = GUICreate("SUPER TYPER DONT SCREW UP", 364, 204, 331, 401)
$edit = GUICtrlCreateEdit("", 8, 32, 289, 153, -1, $WS_EX_CLIENTEDGE)
GUICtrlCreateLabel("Type This :", 8, 8, 57, 17)
$message = GUICtrlCreateLabel("message to type is this message", 80, 8, 155, 17)
$reset = GUICtrlCreateButton("Reset", 312, 48, 41, 113)
GUISetState(@SW_SHOW)
While 1
Quit()
Reset()
HotKeySet("{Backspace}","cheater")
HotKeySet("{Up}","cheater")
HotKeySet("{Down}","cheater")
HotKeySet("{Left}","cheater")
HotKeySet("{Right}","cheater")
If GUICtrlRead($edit) = GUICtrlRead($message) Then
    New()
EndIf
WEnd

Func cheater()
    $cheat += 1
MsgBox(0,"CHEATER","Why dont you go eat some cheetos you freaking cheater, run to safeway and buy them, you'll get there fast cuz ur a cheata")
EndFunc

Func Quit()
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE then Exit
EndFunc

Func Reset()
    $msg = GUIGetMsg()
    If $msg = $reset Then
    GUICtrlSetData($edit,"")
    EndIf
EndFunc

Func New()
    GUICtrlSetData($message,$m[Random(0,4,1)])
    GUICtrlSetData($edit,"")
EndFunc
Edited by thatsgreat2345

Share this post


Link to post
Share on other sites

So if i buy a cd burner and burn songs i bought and "legally" own to disk so i can play the songs in my car while i drive to work i guess thats illegal and i should go to prison..

maybe we should emphasize what keylogging means

Keylogger: A computer program that captures the keystrokes of a computer user and stores them. Modern keyloggers can store additional information, such as images of the users screen. Most malicious keyloggers send this data to a third party remotely (such as via email).

Keylogger:Keystroke logging is a diagnostic used in software development that captures the user's keystrokes. It can be useful to determine sources of error in computer systems. Such systems are also highly useful for law enforcement and espionage for instance, providing a means to obtain passwords or encryption keys and thus bypassing other security measures.

Wacksoff, ask yourself this. Regardless of whether or not he specifically wants something that captures the keystrokes of a computer user and stores them., how trivial would it be for someone to take a script which captures keystrokes and does NOT store them.. and add in 1-2 lines of code and make it so it does. It seems you have missed the point.


AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)

Share this post


Link to post
Share on other sites

k.. the whole point was anyone can take something and turn into something else more over something evil like a keylogger.

Share this post


Link to post
Share on other sites

didnt this topic start out as a questions refering to the basic funtionality of _ispressed () and now its turned into a Keylogger questionaire

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  
Followers 0