Jump to content

Hotkeys - Help Please


Recommended Posts

okay here is my script, I tried launching the compiled exe while holding down either control key and it still processes the commands for If $Signon = 1. what am I doing wrong?

Code is below

Thanks guys,

Kenny

If @OSTYPE = "WIN32_WINDOWS" OR @OSVersion = "WIN_NT4" Then

MsgBox(4096+16, "CWD Brunswick Label System", "This application requires Windows 2000 or XP.")

Exit

EndIf

$DOMAIN = EnvGet("USERDOMAIN")

$USER = @USERNAME

Global $Signon

$Signon = 1

HotKeySet("{LCTRL}", "NoSignon")

HotKeySet("{RCTRL}", "NoSignon")

Sleep(500)

If FileExists(@SCRIPTDIR & "\Shutdown.exe") = 0 Then

MsgBox(4096+16,"CWD Brunswick Label System", "Shutdown.exe could not be found, automatic logoff will be disabled.")

EndIf

LaunchApp()

Do

$RC = ""

$RC = MsgBox(4096+4+48,"CWD Brunswick Label System", "You have closed the Easy-Label application. Would you like to re-open the application?", 10)

If $RC = 6 Then LaunchApp()

Until $RC = 7

Run ( @ScriptDir & "\Shutdown -l", @ScriptDir, @SW_HIDE )

Exit

Func LaunchApp()

Run ( @ScriptDir & "\easy.exe", @ScriptDir, @SW_MAXIMIZE )

If $Signon = 1 Then

WinWait("EASYLABEL Platinum - User Sign On")

WinActivate("EASYLABEL Platinum - User Sign On")

ControlDisable ( "EASYLABEL Platinum - User Sign On", "", "Edit3" )

ControlDisable ( "EASYLABEL Platinum - User Sign On", "", "&New Password (OPTIONAL)" )

ControlSend ( "EASYLABEL Platinum - User Sign On", "", "Edit1", "PRINT", 1 )

ControlSend ( "EASYLABEL Platinum - User Sign On", "", "Edit2", "PRINT", 1 )

Sleep(500)

ControlClick ( "EASYLABEL Platinum - User Sign On", "", "OK" , "left" , 1 )

EndIf

ProcessWaitClose ( "easy.exe")

EndFunc

Func NoSignon()

$Signon = 0

EndFunc

 "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains."

Link to comment
Share on other sites

  • Developers

from the helpfile:

The following hotkeys cannot be set:

Single keys of a-z or A-Z. At least one Alt, Ctrl, or Win modifier is required with these keys.

Ctrl+Alt+Delete It is reserved by Windows

F12 It is also reserved by Windows, according to its API.

NumPad's Enter Key Instead, use {Enter} which captures both Enter keys on the keyboard.

Win+B,D,E,F,L,M,R,U; and Win+Shift+M These are built-in Windows shortcuts. Note: Win+B and Win+L might only be reserved on Windows XP and above.

Alt, Ctrl, Shift, Win These are the modifier keys themselves!

Other Any global hotkeys a user has defined using third-party software, any combos of two or more "base keys" such as '{F1}{F2}', and any keys of the form '{LALT}' or '{ALTDOWN}'.

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

1) You can check the return value of the HotKeySet to see if it worked.

2) Hotkeys only take effect after the script is running. If a key is already pressed down when you launch a script, the hotkey will not register until you lift up and press down again.

Hope that helps

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Link to comment
Share on other sites

does anyone know of anyway to check for a key that has been depressed before the script starts. I don't care what key it is it can be escape for all i care

This script is going to be loaded as a custom shell instead of loading explorer.exe.

 "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains."

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