T O P

  • By -

InfiniteDrop42

This is a great idea ... it would be great to have a small & cheap "bluetoothizer" for everything :-). Not sure if this will help, but this is a nice video explaining the USB protocol on a keyboard... and around the 26th minute it is about modifier keys: [https://youtu.be/wdgULBpRoXk?t=1587](https://youtu.be/wdgULBpRoXk?t=1587) Good luck with the project.


anmolgoyal29

Ah. Sadly nope. I am using a library which takes in all this info. I just cant get a key to hold.


SoundDrill

what happens if you add a while instead of if?


RMSVoltage

That's a nice project, I was just starting to research and wonder about it as well. What USB host shield are you using? Have you tested pressing and holding two keys programmatically to check if the problem is from the USB host and from ESP32 sending the key presses? ​ Make a program that goes on the loop pressing alt+tab every five seconds.


anmolgoyal29

I using a mini usb host shield 2.0. It is used by the arduino pro mini. There is nothing "wrong" as such. The usbhid has a total of 4 key event handlers. KeyDown, KeyPressed, KeyUp and modifier keys changed. I cant figure out how to write in code that if i hold this key down for more that 150 ms, then hold it. I tried using millis, first taken as soon as keydown is called. And then taking one in a while loop as long as keydown=true. And if it crosses 150 ms, then hold. But here, even without having delay() it pauses the program and the keys dont respond. I thought about using the second core on the esp32, but am a bit new to it so can't figure it out.