Jump to content

Modifier Keys staying on....


 Share

Recommended Posts

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:

#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

Link to comment
Share on other sites

Try this, there's probably a better way but its works for me with notepad/wordpad/word

#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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...