Jump to content

Hotkeyset getting stuck?


Recommended Posts

Ok I have written my own script to setup hotkeys for myself. However, they have all been working fine until I tried to add this last one.

Here is the code:

CODE
HotKeySet("#o", "Labsim")

HotKeySet("#i", "Firefox")

HotKeySet("#p", "ControlPanel")

HotKeySet("#c", "Console")

HotKeySet("#a", "AddRemovePrograms")

HotKeySet("^l", "output")

;~ HotKeySet("{ESC}", "Terminate")

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; #e : Opens My computer

; #m : Minimizes all Windows

; #b : Gives Focus to Tray

; #d : Shows Desktop

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

While 1

sleep(100)

WEnd

;;;;;;;;;;;Shortcut Functions;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Func Labsim()

run("C:\Program Files (x86)\TestOut\Orbis\OrbisClient.exe")

EndFunc

Func Firefox()

ShellExecute("firefox.exe")

EndFunc

Func ControlPanel()

Run("control")

EndFunc

Func Console()

Run("C:\Console2\Console.exe")

EndFunc

Func AddRemovePrograms()

Run("control appwiz.cpl")

EndFunc

Func output()

Send("Sending us some text for")

EndFunc

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;~ Func Terminate()

;~ Exit

;~ EndFunc

Now what happens is when I hit ^l to send the text. The button acts as if its stuck and will underline and open a find window because of the u and the f that exists within the text that its sending. Does Autoit have a flush code that releases any key that has been pressed.

Thanks for your help

Link to comment
Share on other sites

Ok I have written my own script to setup hotkeys for myself. However, they have all been working fine until I tried to add this last one.

Here is the code:

CODE
HotKeySet("#o", "Labsim")

HotKeySet("#i", "Firefox")

HotKeySet("#p", "ControlPanel")

HotKeySet("#c", "Console")

HotKeySet("#a", "AddRemovePrograms")

HotKeySet("^l", "output")

;~ HotKeySet("{ESC}", "Terminate")

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; #e : Opens My computer

; #m : Minimizes all Windows

; #b : Gives Focus to Tray

; #d : Shows Desktop

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

While 1

sleep(100)

WEnd

;;;;;;;;;;;Shortcut Functions;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Func Labsim()

run("C:\Program Files (x86)\TestOut\Orbis\OrbisClient.exe")

EndFunc

Func Firefox()

ShellExecute("firefox.exe")

EndFunc

Func ControlPanel()

Run("control")

EndFunc

Func Console()

Run("C:\Console2\Console.exe")

EndFunc

Func AddRemovePrograms()

Run("control appwiz.cpl")

EndFunc

Func output()

Send("Sending us some text for")

EndFunc

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;~ Func Terminate()

;~ Exit

;~ EndFunc

Now what happens is when I hit ^l to send the text. The button acts as if its stuck and will underline and open a find window because of the u and the f that exists within the text that its sending. Does Autoit have a flush code that releases any key that has been pressed.

Thanks for your help

Probably you have something in your output function which uses Send. If so then you must wait untill the CTRL key is released before you call send.
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

I have added some sleep statements in, but that doesnt seem to fix it. I actually have to press the ctrl key on my keyboard so it will release it.

I think that if you ensure that the control key is not pressed before you call send then you won't have a problem. Sleep doesn't ensure that.

See here.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
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...