Jump to content

Control Key Help


DrParko
 Share

Recommended Posts

I am hoping the fine folks on this forum, from which I have learn so much, can help me out. I have a mysterious control key hold happening. I am using several hotkeys, and when most of them are executed, the OS as well as most applications act as if the control key is being held down. I discovered this when I opened outlook in this condition and it told me it thought the control key was being held down, and if I wanted to open in safe mode. I then closed the script and tried holding the control key down in FireFox, Word, and IE and got the same results I have been seeing. Does anyone see something that I don't? Thanks

CODE
#include <GUIConstants.au3>

#include <File.au3>

$MyUserID = "xxxxx"

$Oracle = "yyyyyyy"

$Microsoft = "vvvvv"

Opt("WinTitleMatchMode", 2)

Opt("MouseCoordMode",0)

HotKeySet("^+1", "Paste") ; First Name

HotKeySet("^+2", "Paste") ; MI

HotKeySet("^+3", "Paste") ; Last Name

HotKeySet("^+4", "Paste") ; Email Address

HotKeySet("^+5", "Paste") ; Ticket #

HotKeySet("^+6", "Paste") ; User ID

HotKeySet("^+7", "Paste") ; 6030 Save

HotKeySet("^+8", "Paste") ; PW Save

;HotKeySet("^+9", "Paste")

HotKeySet("^+0", "FocusUp")

HotKeySet("^+x", "ExitScript") ;Exiting Script

$TimeBegin = TimerInit()

$InputForm = GUICreate("Information Input Center", 349, 50, 720, 2, -1, $WS_EX_TOPMOST+$WS_EX_TOOLWINDOW)

$InBoxFName = GUICtrlCreateInput("", 32, 24, 60, 21)

$LblFName = GUICtrlCreateLabel("First", 32, 3, 60, 20)

$InBoxMI = GUICtrlCreateInput("", 95, 24, 20, 21)

$LblMI = GUICtrlCreateLabel("MI", 95, 3, 20, 20)

$InBoxLName = GUICtrlCreateInput("", 118, 24, 60, 21)

$LblLName = GUICtrlCreateLabel("Last", 118, 3, 60, 20)

$InBoxID = GUICtrlCreateInput("", 181, 24, 81, 21)

$Label2 = GUICtrlCreateLabel("User ID", 181, 3, 81, 20)

$InBoxTicket = GUICtrlCreateInput("", 265, 24, 81, 21)

$Label3 = GUICtrlCreateLabel("Ticket #", 265, 3, 81, 20)

$BtnClr = GUICtrlCreateButton("CLR", 3, 24, 25, 20, 0)

GUISetState(@SW_HIDE)

$MainForm = GUICreate("Login Control Center", 220, 170, 850, 150)

$BtnWebRemedy = GUICtrlCreateButton("Remedy - Web", 20, 20, 80, 30, 0)

GUICtrlSetBkColor(-1,0x5CAAFF)

$BtnCliRemedy = GUICtrlCreateButton("Remedy - Client", 20, 70, 80, 30, 0)

GUICtrlSetBkColor(-1,0x5CAAFF)

$BtnOpenAll = GUICtrlCreateButton("Open All", 120, 20, 80, 30, 0)

GUICtrlSetBkColor(-1,0x5CAAFF)

$BtnCloseAll = GUICtrlCreateButton("Close All", 120, 70, 80, 30, 0)

GUICtrlSetBkColor(-1,0x5CAAFF)

$BtnHide = GUICtrlCreateButton("Hide GUI", 20, 120, 80, 30, 0)

GUICtrlSetBkColor(-1,0x00ff00)

$BtnExit = GUICtrlCreateButton("Exit", 120, 120, 80, 30, 0)

GUICtrlSetBkColor(-1,0xF00000)

GUISetBkColor (0x000000)

GUISetState(@SW_SHOW)

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

Call("ExitScript")

Case $BtnWebRemedy

WinActivate("Mozilla Firefox")

Send("u4423rbp")

Send("{TAB}")

Send($Microsoft)

Send("{ENTER}")

GUISetState(@SW_HIDE, $MainForm)

GUISetState(@SW_SHOW, $InputForm)

Case $BtnCliRemedy

WinActivate("BMC Remedy")

Send("u4423rbp")

Send("{TAB}")

Send($Microsoft)

Send("{ENTER}")

GUISetState(@SW_HIDE, $MainForm)

GUISetState(@SW_SHOW, $InputForm)

Case $BtnOpenAll

Call("OpenAll")

GUISetState(@SW_HIDE, $MainForm)

GUISetState(@SW_SHOW, $InputForm)

Case $BtnCloseAll

Call("CloseAll")

Case $BtnHide

GUISetState(@SW_HIDE, $MainForm)

GUISetState(@SW_SHOW, $InputForm)

Case $BtnClr

GUICtrlSetData($InBoxTicket, "")

GUICtrlSetData($InBoxID, "")

GUICtrlSetData($InBoxFName, "")

GUICtrlSetData($InBoxMI, "")

GUICtrlSetData($InBoxLName, "")

Case $BtnExit

Call("ExitScript")

EndSwitch

If WinExists("Connect to u-pass.usace.army.mil") Then

$TimeDiff = TimerDiff($TimeBegin)

if $TimeDiff < 5000 Then

Send($Oracle)

Sleep(1000)

Send("{ENTER}")

Else

Sleep(1000)

Send("u4423rbp")

Send("{TAB}")

Send($Oracle)

Sleep(1000)

Send("{ENTER}")

EndIf

$TimeBegin = TimerInit()

EndIf

If WinExists("UTIL.T_Log") Then

sleep(1000)

WinSetState("UTIL.T_Log","", @SW_MAXIMIZE)

EndIf

If WinExists("Display Attachment") Then

sleep(1500)

WinClose("Display Attachment")

WinClose("Work Info")

EndIf

WEnd

Func OpenAll()

Run("C:\Program Files\Internet Explorer\iexplore.exe","",@SW_MAXIMIZE)

Sleep(2000)

Run("C:\Program Files\Internet Explorer\iexplore.exe https://sharepoint.usace.army.mil/sites/PASS/Shared Documents","",@SW_MAXIMIZE)

Sleep(2000)

Run("C:\Program Files\Mozilla Firefox\firefox.exe","",@SW_MAXIMIZE)

WinWait("Mozilla Firefox")

Sleep(2000)

WinActivate("Mozilla Firefox")

Send($MyUserID)

Send("{TAB}")

Send($Microsoft)

Send("{ENTER}")

Sleep(2000)

Run("C:\Program Files\Microsoft Office\OFFICE11\outlook.exe","",@SW_MAXIMIZE)

Run("C:\WINDOWS\Explorer.exe")

Run("C:\Program Files\Microsoft Office\OFFICE11\excel.exe WeeklyReport.xls")

EndFunc

Func FocusUp()

GUISetState(@SW_SHOW, $MainForm)

GUISetState(@SW_HIDE, $InputForm)

WinActivate("Login Control Center")

EndFunc

Func Paste()

$What = @HotKeyPressed

$FirstName = GUICtrlRead($InBoxFName)

$MiddleI = GUICtrlRead($InBoxMI)

$LastName = GUICtrlRead($InBoxLName)

$Ticket = GUICtrlRead($InBoxTicket)

$UserID = StringUpper(GUICtrlRead($InBoxID))

Switch $What

Case "^+1"

Send($FirstName)

Case "^+2"

Send($MiddleI)

Case "^+3"

Send($LastName)

Case "^+4"

$EmailAddr = $FirstName & "." & $MiddleI & "." &$LastName & "@usace.army.mil"

Send($EmailAddr)

Case "^+5"

Send($Ticket)

Case "^+6"

Send($UserID)

Case "^+7"

$6030Save = $LastName & "." & $FirstName & "-" & $UserID & "-a-" & $Ticket

Send($6030Save)

Case "^+8"

$PwSave = $LastName & "." & $FirstName & "-"

Case "^+9"

MsgBox(0,"Warning", "This Key Not Used at This Time", 3)

EndSwitch

EndFunc

Func CloseAll()

While WinExists("Internet Explorer")

WinClose("Internet Explorer","")

WEnd

While WinExists("Mozilla Firefox")

WinClose("Mozilla Firefox","")

WEnd

While WinExists("Microsoft Outlook")

WinClose("Microsoft Outlook","")

WEnd

While WinExists("Microsoft Excel")

WinActivate("Microsoft Excel")

Send("!f")

sleep (500)

Send("s")

WinClose("Microsoft Excel","")

WEnd

;ProcessClose("explore.exe")

Call("ExitScript")

EndFunc

Func ExitScript()

Exit

EndFunc

Link to comment
Share on other sites

  • 2 weeks later...

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...