Hijikata Posted November 7, 2007 Posted November 7, 2007 im trying to write this script that types out a line depending upon what hot key i set.... but the problem is i am using ctrl+shift+(a letter) and the ctrl and shift keys are acting like they are pressed down AFTER they line is written. here is my code: expandcollapse popup#Include <Date.au3> Global $Date = _NowCalcDate( ) Global $hvac Global $kit Global $cab Global $win HotKeySet("^+u","hvac") HotKeySet("^+i","cab") HotKeySet("^+o","kit") HotKeySet("^+p","win") While 1 sleep(100) WEnd Func hvac() Send($Date) Send(" hvac nono 12m sears apprvd p+9.4% ca Alex",1) Send("{Enter}") EndFunc Func kit() Send($Date) Send(" kit nono 12m sears apprvd p+9.4% ca Alex",1) Send("{Enter}") EndFunc Func cab() Send($Date) Send(" cab nono 12m sears apprvd p+9.4% ca Alex",1) Send("{Enter}") EndFunc Func win() Send($Date) Send(" win nono 12m sears apprvd p+9.4% ca Alex",1) Send("{Enter}") EndFunc thanks for any help
tannerli Posted November 7, 2007 Posted November 7, 2007 i have once experienced the same thing, I didn't find the Problem, but you could send Shift-Up and Ctrl-Up at the end of the functions as a (temporary) workaround Maybe some of the geeks here know the problem better than me
tannerli Posted November 7, 2007 Posted November 7, 2007 Strange, when I had the problem, it worked well... but maybe it's better when we solve it at the cause of the problem. Sorry I couldn't help
picaxe Posted November 7, 2007 Posted November 7, 2007 Try this, there's probably a better way but its works for me with notepad/wordpad/word expandcollapse popup#Include <Date.au3> Global $Date = _NowCalcDate( ) Global $hvac Global $kit Global $cab Global $win HotKeySet("^+u","hvac") HotKeySet("^+i","cab") HotKeySet("^+o","kit") HotKeySet("^+p","win") While 1 sleep(100) WEnd Func hvac() Send($Date) Send(" hvac nono 12m sears apprvd p+9.4% ca Alex",1) Send("{Enter}{CTRLDOWN}{SHIFTDOWN}") Send("{CTRLUP}{SHIFTUP}") EndFunc Func kit() Send($Date) Send(" kit nono 12m sears apprvd p+9.4% ca Alex",1) Send("{Enter}{CTRLDOWN}{SHIFTDOWN}") Send("{CTRLUP}{SHIFTUP}") EndFunc Func cab() Send($Date) Send(" cab nono 12m sears apprvd p+9.4% ca Alex",1) Send("{Enter}{CTRLDOWN}{SHIFTDOWN}") Send("{CTRLUP}{SHIFTUP}") EndFunc Func win() Send($Date) Send(" win nono 12m sears apprvd p+9.4% ca Alex",1) Send("{Enter}{CTRLDOWN}{SHIFTDOWN}") Send("{CTRLUP}{SHIFTUP}") EndFunc
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