use of varibles

Announcements, questions
Post Reply
timmee2222
Posts: 5
Joined: 28 Aug 2015, 00:27

use of varibles

Post by timmee2222 » 28 Aug 2015, 10:26

Hi
I am looking at using the num lck key on an external key pad as a modifier (effectively doubling the number of keys). is it possible to set a variable in luaMaros?

timmee2222
Posts: 5
Joined: 28 Aug 2015, 00:27

Re: use of varibles

Post by timmee2222 » 28 Aug 2015, 10:55

I should really look before I leap - found it in test.lua.
fyi here is my test code...

Code: Select all

clear();
lmc_device_set_name('keyPad', '123F1D63')
--lmc.minimizeToTray = true
numLoc = true

slash = function()
  if(numLoc) then
   lmc_send_keys('It rocks!')
  else
   lmc_send_keys('It rolls!')
  end
end

numLock = function()
 if (numLoc) then
  numLoc = false
 else
  numLoc = true
 end

 if(numLoc) then
  print('numLock is on')
 else
  print('numLock is off')
 end


end

lmc_set_handler('keyPad',111,0,slash)
lmc_set_handler('keyPad',144,0,numLock)

Post Reply