TouchToneDialing Posted January 23, 2010 Share Posted January 23, 2010 Im having a problem with a script not working while im holding down the shift key. Is their anyway I can tell the script to ignore the shift key? Thanks Link to comment Share on other sites More sharing options...
jchd Posted January 23, 2010 Share Posted January 23, 2010 Im having a problem with a script not working while im holding down the shift key. Is their anyway I can tell the script to ignore the shift key? ThanksWelcome to the AutoIt forum!Post the simplest script that exhibits this behavior. This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
rliiack Posted January 23, 2010 Share Posted January 23, 2010 If you want to ignore the shift key, you can put If _isPressed(10) Then EndIf My Projects:Smart Icons Link to comment Share on other sites More sharing options...
TouchToneDialing Posted January 23, 2010 Author Share Posted January 23, 2010 Welcome to the AutoIt forum!Post the simplest script that exhibits this behavior.Here it is. I hit f1, it hits ctrl+variable then 1 then ctrl+variable. It works fine without shift down but doesnt work while holding shift.Func F1 ( ) Send( "^" & $a ) Send( "1" ) Send( "^" & $b )EndFunc Link to comment Share on other sites More sharing options...
TouchToneDialing Posted January 23, 2010 Author Share Posted January 23, 2010 If you want to ignore the shift key, you can put If _isPressed(10) Then EndIf I cant seem to get this to work. Do I just put that anywhere or do I have to put it someplace specific? Im pretty new at this stuff so bare with me and thank you. Link to comment Share on other sites More sharing options...
jchd Posted January 23, 2010 Share Posted January 23, 2010 Here it is. I hit f1, it hits ctrl+variable then 1 then ctrl+variable. It works fine without shift down but doesnt work while holding shift. Read again the help under Send(). It insists that : "Function SendSome programs are very choosy about capital letters and CTRL keys, i.e. "^A" is different to "^a". The first says CTRL+SHIFT+A, the second is CTRL+a. If in doubt, use lowercase!" Try something along this line (untested): Func F1 ( ) Local $leftShift = _isPressed("A0") Local $rightShift = _isPressed("A1") If $leftShift Then Send("{LSHIFT up}") If $rightShift Then Send("{RSHIFT up}") Send( "^" & $a ) Send( "1" ) Send( "^" & $b ) If $leftShift Then Send("{LSHIFT down}") If $rightShift Then Send("{RSHIFT down}") EndFunc This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
TouchToneDialing Posted January 23, 2010 Author Share Posted January 23, 2010 Read again the help under Send(). It insists that : "Function SendSome programs are very choosy about capital letters and CTRL keys, i.e. "^A" is different to "^a". The first says CTRL+SHIFT+A, the second is CTRL+a. If in doubt, use lowercase!" Try something along this line (untested): Func F1 ( ) Local $leftShift = _isPressed("A0") Local $rightShift = _isPressed("A1") If $leftShift Then Send("{LSHIFT up}") If $rightShift Then Send("{RSHIFT up}") Send( "^" & $a ) Send( "1" ) Send( "^" & $b ) If $leftShift Then Send("{LSHIFT down}") If $rightShift Then Send("{RSHIFT down}") EndFunc Thanks for the reply! Im getting an error that says Local $leftShift = _isPressed("A0") Local $rightShift =^ERROR Error:Unkown function name. I guess I need to define what those are? This is a bit over my head hehe. Link to comment Share on other sites More sharing options...
jchd Posted January 23, 2010 Share Posted January 23, 2010 Thanks for the reply!Im getting an error that saysLocal $leftShift = _isPressed("A0")Local $rightShift =^ERRORError:Unkown function name.I guess I need to define what those are? This is a bit over my head hehe.In this case, the help is always there! You need to insert this line with other #includes, before your code and variables:#Include <Misc.au3> This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
TouchToneDialing Posted January 23, 2010 Author Share Posted January 23, 2010 In this case, the help is always there! You need to insert this line with other #includes, before your code and variables:#Include <Misc.au3>Sorry, so I should just put that at the top exactly like it is or should the name be different? I read the autoit docs about include but im a bit confused. I put it exactly like that at the top, everything worked but the function still didnt work while shift was down. Link to comment Share on other sites More sharing options...
jchd Posted January 23, 2010 Share Posted January 23, 2010 everything worked but the function still didnt work while shift was down.It's possible the program you're sending keystrokes to monitors the keyboard at a lower level, or there is something specific with it. What program is it? And why do you maintain shift down precisely at this moment? This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
TouchToneDialing Posted January 23, 2010 Author Share Posted January 23, 2010 It's possible the program you're sending keystrokes to monitors the keyboard at a lower level, or there is something specific with it. What program is it? And why do you maintain shift down precisely at this moment?The program is a game and shift is the sprint button. Basically I would like to be able to use these hot keys while holding down shift to sprint. Link to comment Share on other sites More sharing options...
jchd Posted January 23, 2010 Share Posted January 23, 2010 The program is a game and shift is the sprint button. Basically I would like to be able to use these hot keys while holding down shift to sprint.I see. Games often use low-level or uncomon tricks. I've no good answer for you then, sorry. This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
TouchToneDialing Posted January 23, 2010 Author Share Posted January 23, 2010 I see. Games often use low-level or uncomon tricks. I've no good answer for you then, sorry.No problem. Thanks for giving it a shot for me! 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