Using NumPad Keys on a exernal numpad

How can be this controlled in that simulator? Can HIDmacros be used with this application?
Post Reply
Jojoistcool2509
Posts: 1
Joined: 13 Oct 2021, 13:32

Using NumPad Keys on a exernal numpad

Post by Jojoistcool2509 » 13 Oct 2021, 13:42

I can't use my Numpad Keys because it always says that it doesn't know these keys but i tried everything like NUM1, NUM_1, 1, 1NUM. I also tried it while NumLock was on and off but it didn't work. Please help me make it work.
The NumPad is a LogiLink one btw.
Here's my code(i used the sample)

Code: Select all

-- assign logical name to macro keyboard
lmc_assign_keyboard('MACROS');

-- define callback for whole device
lmc_set_handler('MACROS',function(button, direction)
  if (direction == 1) then return end  -- ignore down
  if     (button == string.byte('NUM1')) then lmc_spawn("calc")
  elseif (button == string.byte('NUM2')) then lmc_spawn("notepad", "C:\\test.txt")
  elseif (button == string.byte('NUMPLUS')) then lmc_send_keys('Hi')
  else print('Not yet assigned: ' .. button) 
  end
end)       

admin
Site Admin
Posts: 735
Joined: 01 Nov 2010, 13:00
Location: Prague, Czech republic
Contact:

Re: Using NumPad Keys on a exernal numpad

Post by admin » 14 Oct 2021, 07:44

You don't have to use string.byte. Just use the number itself in condition - the one being printed as not assigned.
Petr Medek
LUAmacros author

Post Reply