Page 1 of 1

Doesn't block keys in notepad++

Posted: 23 Apr 2018, 10:49
by base64
Hi,

I've just discovered Luamacros a few days ago. It is awesome. Thank you for your work.

I am having a problem that original keystrokes are still being sent to notepad++

For example, the code below blocks all keys, except in notepad++, where the keys are still being sent.

Code: Select all

lmc_assign_keyboard('MACRO')
lmc_set_handler('MACRO', function(button, direction)
end) 
And another example, running the code below and when numpad1 is pressed it prints "xyz" in other programs. Except in notepad++, it prints "1xyz"

Code: Select all

lmc_assign_keyboard('MACRO')
lmc_set_handler('MACRO', function(button, direction)
if (direction == 0) then return
elseif (button == 97) then lmc_send_keys('xyz') end
end) 
Is it possible to also block keystrokes in notepad++?

Re: Doesn't block keys in notepad++

Posted: 24 Apr 2018, 08:33
by admin
Hmm, hard to say fix something that works for me :-/.
Aren't you running Notepad++ as admin and luamacros as regular user?

Re: Doesn't block keys in notepad++

Posted: 24 Apr 2018, 09:13
by base64
I was running luamacros as admin and notepad++ regular.

Actually, running luamacros without admin rights fixed it for me. :shock:

Thanks for your help.

Re: Doesn't block keys in notepad++

Posted: 08 Jun 2018, 10:21
by plc
Hi

I have a similar issue. I'm using the quick start sample and when typing "h" I get hHello World

the 'h' is still send to word/terminal/anything. Tested it in normal and admin mode

I'm running LUAMacros on a Windows 7 host

What am I missing ?

Thx

Re: Doesn't block keys in notepad++

Posted: 23 Aug 2018, 12:41
by bungie
I've got the same issue. Any fix?

Re: Doesn't block keys in notepad++

Posted: 17 Jan 2021, 06:39
by Maggie
hi guys,
i see the problem,
the button command works only DURING RELEASE . So when you press it records the original key letter and then when you release it gives you the modified letter that you want.

i tried with
function press(key)
lmc_send_input(string.byte(key), 0, 0) -- press
lmc_send_input(string.byte(key), 0, 2) -- release
end

how to use this any suggestion ?