Page 1 of 1

Enable Key echo for unchanged keys

Posted: 09 Dec 2015, 14:39
by alex
Hello.
Basically I'm trying to change two buttons behavior.

For hidmacros it was like this :

Code: Select all

 <Macros>
    <Macro>
      <Device>Keyb10</Device>
      <Name>New Macro2</Name>
      <KeyCode>45</KeyCode>
      <Direction>down</Direction>
      <Action>SEQ</Action>
      <Sequence>{END}</Sequence>
      <SCEvent></SCEvent>
      <XPLCommand></XPLCommand>
      <ScriptSource></ScriptSource>
      <SCText>0</SCText>
      <SCParams></SCParams>
      <Command></Command>
    </Macro>
    <Macro>
      <Device>Keyb10</Device>
      <Name>New Macro3</Name>
      <KeyCode>35</KeyCode>
      <Direction>down</Direction>
      <Action>SEQ</Action>
      <Sequence>{INS}</Sequence>
      <SCEvent></SCEvent>
      <XPLCommand></XPLCommand>
      <ScriptSource></ScriptSource>
      <SCText>0</SCText>
      <SCParams></SCParams>
      <Command></Command>
    </Macro>
  </Macros>
There is a couple questions :
1) How to send keycode and not chars using luamacros
2) How to send original button keycode unless it hooked using luamacros?

thanks in advance for answers.

Re: Enable Key echo for unchanged keys

Posted: 09 Dec 2015, 14:56
by alex
Done :)

Code: Select all

-- assign logical name to macro keyboard
print(lmc_device_set_name('MACROS', 'ACPI#MSFT0001'));
 lmc_print_devices();

lmc_set_handler('MACROS',45,1,function(button, direction)
  print ("hook INS");
  lmc_send_keys("{END}")
end)
lmc_set_handler('MACROS',35,1,function(button, direction)
  print ("hook END");
  lmc_send_keys("{INS}")
end)