Help With My Program

Deploying to Windows? Utilizing VB Script execution? This is the place to ask Windows-specific questions.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
7Leven
Posts: 18
Joined: Sat Oct 11, 2014 2:06 am

Help With My Program

Post by 7Leven » Sat Oct 11, 2014 2:14 am

I'm trying to run a program in the background of Windows.

I.E When the program is minimized, it should still be running.

What I'm doing is detecting the keys that I press in certain combinations while I play a video game to determine exactly how many times I use a certain attack or combination.

And when I minimize the compiled program, it doesn't record my keystrokes on these certain buttons. Here is my code:

Code: Select all

local backSlashAttack
local healParty
local useMount
local useSpecial

on keyUp key 
   switch key
      case "k"
         put backSlashAttack + 1 into backSlashAttack
         put backSlashAttack into field "lblBackSlash"
         break
      case "l" 
         put healParty + 1 into healParty
          put healParty into field "healParty"
         break 
      case "o"
         put useMount + 1 into useMount
          put useMount into field "useMount"
         break
      case "m"
         put useSpecial + 1 into useSpecial
          put useSpecial into field "useSpecial"
         break
      case ","
         put useTele + 1 into useTele
          put useTele into field "useTele"
         break
   end switch
end keyUp
All of this is on the stack level and I'm having these variables display on fields in my first card.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7390
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Help With My Program

Post by jacque » Sat Oct 11, 2014 5:47 pm

The OS only sends key events to the active application. Other apps won't know any keys are pressed.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply