-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Closed
Labels
Status: SolvedThe issue has been resolved and requires no further action.The issue has been resolved and requires no further action.
Description
Board
ESP32-Dev-Module
Device Description
My original Keyboard prototype with ESP32-S3-WROOM-1
Hardware Configuration
In my Keyboard, GPIO 10, 11, 12, 9, 46, 3 are used as Scan lines and GPIO 42, 41, 40, 39, 38, 37, 36, 35, 45, 48, 47, 21, 14, 13, 8, 2, 1 are used as Read lines. Read lines are internally pulluped.
- Left Ctrl key is located between GPIO 42 and 3
- Left Shift key is located between GPIO 42 and 46
- Left Win key is located between GPIO 41 and 3
- Left Alt key is located between GPIO 40 and 3
- Right Ctrl key is located between GPIO 13 and 3
- Right Shift key is located between GPIO 13 and 46
- Right Alt key is located between GPIO 14 and 3
Version
latest master (checkout manually)
IDE Name
Arduino IDE 2.3.2
Operating System
Windows 11
Flash frequency
80 MHz
PSRAM enabled
yes
no
Upload speed
921600
Description
Both Ctrl, Alt, Shift, Win keys on my keyboard do not work independently.
Like this : When I pressing the Ctrl key, did not show any response on the keyboard test
Keyboard test site : https://www.onlinemictest.com/ja/keyboard-test/
But, when I use this keyboard with BLE connection, they worked.
I would expect all keys to respond when pressed independently of each other.
Sketch
https://gist.github.com/53175ddd/0d95b3d494cd21595637ed0d233a8b87
Debug Message
https://gist.github.com/53175ddd/7e271aee10666b8f2d6727d983181fdc
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
- I confirm I have checked existing issues, online documentation and Troubleshooting guide.To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel.
Metadata
Metadata
Assignees
Labels
Status: SolvedThe issue has been resolved and requires no further action.The issue has been resolved and requires no further action.
Activity
53175ddd commentedon Jun 1, 2024
I have mistake
I don't use PSRAM
[-]some keys cannot use with ESP32-S3[/-][+]some keys doesn't work (ESP32-S3 USB-HID)[/+]53175ddd commentedon Jun 1, 2024
This is a schematic
HT-Keys-TKL_v2.pdf
me-no-dev commentedon Jun 1, 2024
it's not clear exactly which type of S3 you are using. If it has on-board OPI PSRAM, then GPIOs 35-37 are not to be used. Please enable debug to level Verbose and post the output of UART
53175ddd commentedon Jun 1, 2024
Thank you for your reply.
In my sketch, each PSRAM option is disabled. (image below)
this is an output with Verbose level debug
me-no-dev commentedon Jun 1, 2024
there were some prints before and after setup, showing your chip, config, etc. We need those :)
53175ddd commentedon Jun 2, 2024
So, what should I do ?
Do I have to add some codes ?
SuGlider commentedon Jun 4, 2024
if the sketch executes
usbkbd.pressRaw(HID_KEY_SHIFT_LEFT);
, does it show up in the keyboard test?https://github.com/hathach/tinyusb/blob/master/src/class/hid/hid.h#L578-L586
SuGlider commentedon Jun 4, 2024
What Arduino Core version is this project using?
There is a FIX to USB Keyboard that must be in place for the Key Modifiers (SHIFT, CTRL, ALT etc)
#9473
This Fix is available in the Arduino Core 3.0.0-RC1 and forward.
53175ddd commentedon Jun 4, 2024
I'm using 3.0.0 (not RC).
53175ddd commentedon Jun 4, 2024
@SuGlider
I tried this test.
I added this code at the end of
setup()
.In the keyboard test, the left shift key is being pressed and released.
Should I replace
usbkbd.press()
tousbkbd.pressRaw()
?SuGlider commentedon Jun 4, 2024
Yes, it is possible, but the parameters are different for
press()
andpressRaw()
.usbkbd.pressRaw(HID_Key_Code); // takes a HID Key Code Key as parameter.
usbkbd.press(ASCII_Char); // takes an ASCII code as parameter.
HID Key Codes can be seen here:
https://github.com/hathach/tinyusb/blob/master/src/class/hid/hid.h#L366-L587
or here:
https://gist.github.com/MightyPork/6da26e382a7ad91b5496ee55fdc73db2
The sketch you have presented uses ASCII as key code.
You may need to change it in https://gist.github.com/53175ddd/0d95b3d494cd21595637ed0d233a8b87#file-sketch-ino-L130-L218
More information in USB ORG documentation (HID Codes in Chapter 10)
https://usb.org/sites/default/files/hut1_21.pdf
53175ddd commentedon Jun 4, 2024
Thank you so much. I understood.
I change my code like this.
Then my keyboard works well !!
VojtechBartoska commentedon Jun 4, 2024
Marking as solved and closing :)
4 remaining items