deckerego / Macropad_Hotkeys

A derivative of the Macropad Hotkeys example from the Adafruit Learning System Guide
MIT License
44 stars 13 forks source link

How to have a macro that is combination plus single button #8

Closed ObligedTester closed 6 months ago

ObligedTester commented 1 year ago

Hello,

Trying to figure out how to have a macro set to CTRL-K and then a Z.

This is for example for Visual Studio "Zen" Mode. I can only get it to do CTRL-K-Z for example, but i need it to release CTRL-K before sending Z.

Any ideas?

deckerego commented 1 year ago

@ObligedTester - correct, you can only send key combinations at once, you can't add a delay between them. I'll keep this issue open as an enhancement to add & will look at coding that feature.

ObligedTester commented 1 year ago

I see!

That would be great to be able to do this.

Even for such programs as vim, you would be able to have complete commands as macros with this!

Thank you for this reply and update. I will keep an eye for any updates.

deckerego commented 1 year ago

Looking at implementing DuckyScript for the macros

ObligedTester commented 11 months ago

Not familiar with that, but let me know if you need any assitance with testing or so!

deckerego commented 6 months ago

@ObligedTester - finally got things implemented! A sample command is:

(0x544408, 'World  ', [[Keycode.SHIFT, Keycode.W], 2.0, Keycode.O, 1.0, [Keycode.R, Keycode.L], 3.0, Keycode.D]),

Which is a macro that would output:

Wooooorld

This is because the macro is interpreted as:

  1. Press SHIFT+W
  2. Release SHIFT+W
  3. Pause 2 seconds
  4. Press O
  5. Pause 1 second
  6. Release O
  7. Press R and L at the same time
  8. Release R and L at the same time
  9. Wait 3 seconds
  10. Press D
  11. Release D

Let me know if this does or doesn't work!