DigitalLocksmith Posted June 22, 2007 Share Posted June 22, 2007 (edited) Is it possible with _IsPressed to redirect or run a file when a group of words or a specific string is typed in succession, kind of like a realtime bad word filter? The redirect part is easy, but I'm not sure how to get it to recognize that an exact specific string was entered. Any ideas? When "cat" is typed I want to MsgBox...not "tac" or "act" CODE#include <Misc.au3> $dll = DllOpen("user32.dll") While 1 Sleep ( 250 ) If _IsPressed("43", $dll) + _IsPressed("41", $dll) + _IsPressed("54", $dll) Then MsgBox(0,"_IsPressed", "End Key Pressed") ExitLoop EndIf WEnd DllClose($dll) Edited June 22, 2007 by DigitalLocksmith Link to comment Share on other sites More sharing options...
DigitalLocksmith Posted June 22, 2007 Author Share Posted June 22, 2007 Any Help at all? Link to comment Share on other sites More sharing options...
FreeFry Posted June 22, 2007 Share Posted June 22, 2007 CODE#include <Misc.au3>$dll = DllOpen("user32.dll")While 1 Sleep ( 250 ) If _IsPressed("43", $dll) + _IsPressed("41", $dll) + _IsPressed("54", $dll) Then MsgBox(0,"_IsPressed", "End Key Pressed") ExitLoop EndIfWEndDllClose($dll)That would only detect if you hold ALL the buttons down..You'd have to create some kind of function, that detects when one key was pushed, then check if the next expected key is pressed within some time(0.5 to 1 second), and the same again for the next key.. Link to comment Share on other sites More sharing options...
Xand3r Posted June 22, 2007 Share Posted June 22, 2007 (edited) works:) btw you could use a timer because this prog records test even if letters are tiped after hours and hours and... Edit: forgot code tags Edited June 22, 2007 by alexmadman Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro Link to comment Share on other sites More sharing options...
jvanegmond Posted June 22, 2007 Share Posted June 22, 2007 (edited) I once did this for 001 using Larry's mousehook. May be a bit difficult, but it definitely rocks.http://www.autoitscript.com/forum/index.ph...st&p=247970Edit: Get the DLL here: http://www.autoitscript.com/forum/index.php?showtopic=23173 Edited June 22, 2007 by Manadar github.com/jvanegmond Link to comment Share on other sites More sharing options...
_Kurt Posted June 22, 2007 Share Posted June 22, 2007 I once did this for 001 using Larry's mousehook. May be a bit difficult, but it definitely rocks. http://www.autoitscript.com/forum/index.ph...st&p=247970 Edit: Get the DLL here: http://www.autoitscript.com/forum/index.php?showtopic=23173Wow, that's really cool, but I have a question.. Looking over your script I understand everything, at the exception of this line(s): If $WParam = 0x00000060 OR $WParam = 0x00000030 Then I understand that 0x00000030 is equal to 0, but why include 0x00000060 in your If..EndIf statement? If I'm not mistaken I believe 0x00000060 is equal to = ? Why would you want that? The example script is very nice, I'm glad you shared it with the forum. This can help me at many occasions, time to play around with it Thanks, Kurt Awaiting Diablo III.. Link to comment Share on other sites More sharing options...
Siao Posted June 22, 2007 Share Posted June 22, 2007 (edited) 0x60 and 0x61 is for numpad 0 and 1. Edited June 22, 2007 by Siao "be smart, drink your wine" Link to comment Share on other sites More sharing options...
_Kurt Posted June 22, 2007 Share Posted June 22, 2007 (edited) Thanks Siao, I'm not familiar with that stuff Kurt EDIT: Lovin' the sig, siao! Edited June 22, 2007 by _Kurt Awaiting Diablo III.. Link to comment Share on other sites More sharing options...
cppman Posted June 22, 2007 Share Posted June 22, 2007 (edited) What about something like this? #include <misc.au3> Global $Word = "CAT" Global $ÕYÛÜH ][ÝÉ][ÝÂÚ[JJBIÌÍØÚHÑÙ]ÚXÝÜÙY BZYb33c¶6fÇC²fwC²ÓFVà b33cµGVEv÷&Bf׳Òb33c¶6 FööÅFbÀÌØíQåÁ]½É°À°À¤($%M±À ÄÀÀ¤(%¹%($(%¥¡MÑÉ¥¹%¹MÑÈ ÀÌØíQåÁ]½É $Word)) Then MsgBox(0, "", "You typed cat!"BBIÌÍÕYÛÜH ][ÝÉ][ÝÂQ[YÑ[[ÈÑÙ]ÚXÝÜÙY Bf÷"b33c¶ÒFò#SP bô5&W76VBWb33c¶Â"FVà &WGW&â6È ÀÌØí¤¤($%¹%(%9áÐ(%ÉÑÕɸ´Ä)¹Õ¹ Edited June 22, 2007 by chris95219 Miva OS Project Link to comment Share on other sites More sharing options...
FreeFry Posted June 22, 2007 Share Posted June 22, 2007 Wow, that's really cool, but I have a question.. Looking over your script I understand everything, at the exception of this line(s): If $WParam = 0x00000060 OR $WParam = 0x00000030 Then I understand that 0x00000030 is equal to 0, but why include 0x00000060 in your If..EndIf statement? If I'm not mistaken I believe 0x00000060 is equal to = ? Why would you want that? The example script is very nice, I'm glad you shared it with the forum. This can help me at many occasions, time to play around with it Thanks, Kurt 0x00000030, and 0x00000060 is hex values(all values starting with 0x is hex values), which is NOT equal to 0(actually, 0x00000030, can be written as 0x30, and is equal to decimal 48, same with 0x60, equals to decimal 96) Link to comment Share on other sites More sharing options...
DigitalLocksmith Posted June 23, 2007 Author Share Posted June 23, 2007 Awesome...Both of these solutions are working. I do still have one question though. If one of the words is capitalized, the shift key sticks. I've tried to release it by Send("{SHIFTDOWN}{SHIFTUP}") and variants of up and down to no avail. How do you get around this? Also in chris95219's example, if you hold the key for more than a milisecond or so it registers multiple times and doesn't recognize the word. I think the send delay needs to be adjusted, but I haven't figured out how to make it work yet. Advice? Link to comment Share on other sites More sharing options...
DigitalLocksmith Posted June 26, 2007 Author Share Posted June 26, 2007 Anybody there on the stuck shift key question above? 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