Hi, total beginner here, maybe someone can point out the issue.
I started modifing the macropad hotkeys example for Adobe Illustrator for Windows to see if it will work for other software.
I have an issue with the shortcut CTRL - 1 that I would like to use in trading software called TC2000.
After writing it in and saving to the macropad this particular command doesnt work in the software. If I test that hotkey on the macropad with google chrome then it jumps to the first open tab, which confirms that its working. Pressing CTRL-1 on my keyboard works in TC2000.
What could be the cause? Thanks
Macropad shortcut key issue
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- expiredparrot
- Posts: 3
- Joined: Sun May 22, 2022 6:46 am
Macropad shortcut key issue
- Attachments
-
- Screenshot 2022-05-22 135652 - macropad.jpg (378.39 KiB) Viewed 148 times
- neradoc
- Posts: 542
- Joined: Wed Apr 27, 2016 2:38 pm
Re: Macropad shortcut key issue
Try adding making it hold the shortcut while you hold the key. Maybe the software needs it to be held a little bit.
When you put a string in a shortcut, the corresponding key is not held (it simulates typing it, which releases the key immedidately).
You could also add a delay to make sure the key is held, like 0.1 seconds here.
If that doesn't help, I don't know what the issue could be.
When you put a string in a shortcut, the corresponding key is not held (it simulates typing it, which releases the key immedidately).
Code: Select all
[Keycode.CONTROlL, Keycode.ONE]
Code: Select all
[Keycode.CONTROlL, Keycode.ONE, 0.1]
- expiredparrot
- Posts: 3
- Joined: Sun May 22, 2022 6:46 am
Re: Macropad shortcut key issue
thanks neradoc. i think you are correct. I couldn't make it work by playing with the delay just yet.
How would you code it to press 1 while holding CTRL?
Thanks
How would you code it to press 1 while holding CTRL?
Thanks
- neradoc
- Posts: 542
- Joined: Wed Apr 27, 2016 2:38 pm
Re: Macropad shortcut key issue
Depends what you mean, the way the hotkeys code works it presses the keys in order, normally as fast as possible, and releases them when you release the key. If you want to hold ctrl a little bit before, and a little bit after pressing 1 you can use the minus sign to release a key.expiredparrot wrote:thanks neradoc. i think you are correct. I couldn't make it work by playing with the delay just yet.
How would you code it to press 1 while holding CTRL?
Thanks
This for example would press ctrl, wait 100ms, press 1, wait, release 1, wait, release ctrl, and does not hold anything (so it doesn't matter when you release the macropad's key).
[Keycode.CONTROL, 0.1, Keycode.ONE, 0.1, -Keycode.ONE, 0.1, -Keycode.CONTROL]
- expiredparrot
- Posts: 3
- Joined: Sun May 22, 2022 6:46 am
Re: Macropad shortcut key issue
Thanks Neradoc.
It works!!!
It works!!!
Please be positive and constructive with your questions and comments.