Jump to content

Capslock issue


Guest tmcradnet
 Share

Recommended Posts

Guest tmcradnet

I am having a problem with caps lock. I have an app that registeres a hotkey when you are in one application but (theoretically) frees up the key when you are in any other application. Right now it works fine until a user pushes caps lock. When a user pushes caps lock all letters are in lowercase. I saw some examples on this forum but it doesn't seem to work. I simplified my code to test this out, basically if you are in freecell the message box pops up but once you go into word the capslock doesn't register.

Thanks

Ben

HotKeySet("i", "FunOne");inverts image


While 1
    Sleep(100)
WEnd



Func FunOne()
If WinActive("FreeCell") Then
        MsgBox(4096, "MenuBox", "You are in FreeCell", 10)

    Else
            HotKeySet("i")
            Send("i")
            HotKeySet("i", "FunOne")

    Endif

EndFunc
Link to comment
Share on other sites

HotKeySet("i", "FunOne");inverts image
HotKeySet("I", "FunOne")

While 1
    Sleep(100)
WEnd



Func FunOne()
If WinActive("FreeCell") Then
        MsgBox(4096, "MenuBox", "You are in FreeCell", 10)

    Else
            HotKeySet("i")
HotKeySet("I")
            Send("i")
            HotKeySet("i", "FunOne")
HotKeySet("I", "FunOne")
    Endif
EndFunc

Link to comment
Share on other sites

Try this:

HotKeySet("i", "FunOne");inverts image
HotKeySet("+i", "FunOne")

While 1
   Sleep(100)
WEnd



Func FunOne()
   If WinActive("FreeCell") Then
      MsgBox(4096, "MenuBox", "You are in FreeCell", 10)
   Else
      HotKeySet("i")
      HotKeySet("+i")
      Send("i")
      HotKeySet("i", "FunOne")
      HotKeySet("+i", "FunOne")
   Endif
EndFunc

Is there a way I can pause a script when a window isn't active and then reengage it once it is selected?

This script basically does that. It keeps running (in the background) until the window is active. However, if you just want the script to pause, take a look at WinWaitActive() or WinExists().

Edit: code looked strange

Edited by SerialKiller
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...