Closed arjena closed 1 year ago
This looks like a problem at the OS level, rather than a problem with your code. If I understand correctly, the issue is that, if you press Command on one keyboard and C on another keyboard, the OS does not interpret that as the Command+C combination.
The only solution I can think of is to connect your keyboard to the Arduino, and have the Arduino forward the key actuations to the computer… adding the modifiers. Then, as far as the computer is concerned, there is only one keyboard. You would need something like a USB host shield. I have no experience with those.
Thanks for your reply and yes, you are right. I just attached an extra keyboard to my laptop and indeed pressing a modifier on one and a key on the other does not take the modifier into account. Hopefully someone knows how to solve this. I have an Arduino due with two usb ports, where one is supposed to have USB-host capabilities. Will definitely check this tomorrow.
I am trying to make four buttons to act as modifiers (I'm on a Mac, so those are command, alt, control and shift). In my work, most of the time I use my left hand only to press these buttons on the keyboard and my right hand to draw on a tablet, use the mouse and type a single character. For instance command-alt-forwardslah or command-'plus sign'. You get the picture. Due to an operation I will not be able to use my left hand for a while so I thought if I can use my feet to press the modifiers, I can still work with only my right hand. My code is 'sort of' working. If I press one of the buttons, functions in the OS are modified as expected. Like selecting multiple items (shift or command key), right mouse click (control) and copy drag files (alt). But pressing one (or multiple) key and a key on the (real) keyboard does not work. And that is the whole point of these buttons. Is it at all possible what I am trying to achieve or is my code simply faulty?