<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Tab5 USBHIDKeyboard]]></title><description><![CDATA[<p dir="auto">I am attempting to use Tab5 to send keyboard events through a usb connection. I am able to use similar code to send keystrokes when using a Cardputer. I took the touch button example and added keyboard print(string) and write(keycode) to the button event. I also tried adding a delay after calling keyboard.begin()</p>
<p dir="auto">Using the same cable connection, the Cardputer successfully sends keyboard events to the computer, but the computer does not seem to receive any events from the Tab5.</p>
<p dir="auto">Is any way I can try to debug this?</p>
<pre><code>#include &lt;M5Unified.h&gt;
#include &lt;M5GFX.h&gt;

#include "USB.h"
#include "USBHIDKeyboard.h"

m5::touch_detail_t touchDetail;
static int32_t w;
static int32_t h;

LGFX_Button button;

USBHIDKeyboard Keyboard;

void setup() {
  M5.begin();

  w = M5.Lcd.width();
  h = M5.Lcd.height();
  
  M5.Lcd.fillScreen(WHITE);
  M5.Display.setRotation(0);
  M5.Display.setTextDatum(top_center);
  M5.Display.drawString("Button Released", w / 2, 0, &amp;fonts::FreeMonoBold24pt7b);

  button.initButton(&amp;M5.Lcd, w / 2, h / 2, 200, 200, TFT_BLUE, TFT_YELLOW, TFT_BLACK, "BTN", 4, 4);
  button.drawButton();


  Keyboard.begin();
  USB.begin();
  delay(4000);

  M5.Display.drawString("usb done", w / 2, 100, &amp;fonts::FreeMonoBold24pt7b);
  
}



void loop() {
  M5.update();
  touchDetail = M5.Touch.getDetail();

  if (touchDetail.isPressed()) {
    if(button.contains(touchDetail.x, touchDetail.y)){
        M5.Display.drawString("Button  Pressed", w / 2, 0, &amp;fonts::FreeMonoBold24pt7b);
        Keyboard.print("hello");
        Keyboard.write(KEY_RETURN);
        delay(2000);
    }
  }
  else {
    M5.Display.drawString("Button Released", w / 2, 0, &amp;fonts::FreeMonoBold24pt7b);
  }
} 

</code></pre>
]]></description><link>https://community.m5stack.com/topic/7689/tab5-usbhidkeyboard</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Mar 2026 11:00:34 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/7689.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 15 Jul 2025 21:03:15 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Tab5 USBHIDKeyboard on Tue, 03 Mar 2026 15:37:40 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/223073">@LETSOC</a></p>
<p dir="auto">Thank you for the confirmation LETSOC. I attempted to update m5stack libraries and device files for arduino IDE this week and compiled the code again, but HID functionality is still not working on Tab5.</p>
<p dir="auto">I was excited to try using the Tab5 as an advanced pocket macropad, but without HID this is not possible yet. I'm glad to at least have the Cardputer working.</p>
]]></description><link>https://community.m5stack.com/post/30707</link><guid isPermaLink="true">https://community.m5stack.com/post/30707</guid><dc:creator><![CDATA[poydayelmu]]></dc:creator><pubDate>Tue, 03 Mar 2026 15:37:40 GMT</pubDate></item><item><title><![CDATA[Reply to Tab5 USBHIDKeyboard on Mon, 24 Nov 2025 11:59:50 GMT]]></title><description><![CDATA[<p dir="auto">ab5 can work as a USB HID keyboard when used in USB-host mode make sure you’re using the correct USB Host wiring and the HID example/library, test with a simple key report first, and verify power/ground are stable (some USB keyboards need extra 5V supply). See discussions and example code in this thread: <a href="https://community.m5stack.com/topic/">https://community.m5stack.com/topic/</a><a href="https://estateagentsilford.co.uk/buying/" target="_blank" rel="noopener noreferrer nofollow ugc">buyers agent/</a><a href="https://community.m5stack.com/topic/7689/tab5-usbhidkeyboard">7689/tab5-usbhidkeyboard</a> and check the official docs for that should get you started; post your wiring and code snippets here if you want specific debugging.</p>
]]></description><link>https://community.m5stack.com/post/30230</link><guid isPermaLink="true">https://community.m5stack.com/post/30230</guid><dc:creator><![CDATA[LukeMathew456]]></dc:creator><pubDate>Mon, 24 Nov 2025 11:59:50 GMT</pubDate></item><item><title><![CDATA[Reply to Tab5 USBHIDKeyboard on Fri, 14 Nov 2025 22:41:21 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/313706">@jalmalogni</a> I am looking at exploring something similar and didn’t manage also. I looked at the MAX3421e usb module v1.2 I was hoping that would make it happen but seems like the communication doesn’t happen. Power comes out and powers the usb peripherals but no communication data.<br />
Annoying as on paper this should be possible I am wondering if you had any success with your project and can share any details.<br />
Thanks<br />
<a href="https://www.reddit.com/r/M5Stack/s/eouUCClf3M" target="_blank" rel="noopener noreferrer nofollow ugc">reddit</a></p>
]]></description><link>https://community.m5stack.com/post/30185</link><guid isPermaLink="true">https://community.m5stack.com/post/30185</guid><dc:creator><![CDATA[LETSOC]]></dc:creator><pubDate>Fri, 14 Nov 2025 22:41:21 GMT</pubDate></item><item><title><![CDATA[Reply to Tab5 USBHIDKeyboard on Fri, 25 Jul 2025 17:52:38 GMT]]></title><description><![CDATA[<p dir="auto">Thank you for your time and help yuyun2000!</p>
<p dir="auto">I am using ArduinoIDE. I have attempted to setup PlatformIO, but I was not able to find any information on setting up PlatformIO for the Tab5. I also tried UIFlow2, but when I tried to use M5Burner to load the firmware on the Tab5, it would just display a window with no firmware options.</p>
<p dir="auto">I tried the simplified code. I do not know how to trigger BtnA.wasPressed, so I copied the Keyboard.print and Keyboard.write to the end of the setup function.</p>
<p dir="auto">This code does work OK for the Cardputer, but there is no keyboard output when using the same simplified code with the same usb cable on the Tab5.</p>
<p dir="auto">I have tested this on the Tab5 with the battery attached, but there is still no keyboard output.</p>
<p dir="auto">I have only been able to get ArduinoIDE working so far, and I have attempted setting up ArduinoIDE on a new Fedora installation with the same results.</p>
<p dir="auto">Has anyone been successful in getting OTG HID keyboard output from the Tab5?</p>
]]></description><link>https://community.m5stack.com/post/29616</link><guid isPermaLink="true">https://community.m5stack.com/post/29616</guid><dc:creator><![CDATA[jalmalogni]]></dc:creator><pubDate>Fri, 25 Jul 2025 17:52:38 GMT</pubDate></item><item><title><![CDATA[Reply to Tab5 USBHIDKeyboard on Thu, 17 Jul 2025 09:10:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/313706">@jalmalogni</a> To debug the USB keyboard issue with your Tab5 (SKU:C145/K145), please try the following steps:</p>
<p dir="auto">Verify USB OTG Configuration: Ensure your code correctly initializes USB OTG mode. Add these build flags to your PlatformIO configuration:<br />
build_flags =<br />
-DARDUINO_USB_CDC_ON_BOOT=1<br />
-DARDUINO_USB_MODE=1</p>
<p dir="auto">Check USB Initialization Order: Modify the initialization sequence in setup():<br />
USB.begin();          // Initialize USB first<br />
delay(1000);          // Add delay before keyboard initialization<br />
Keyboard.begin();</p>
<p dir="auto">Monitor USB Enumeration: Connect via WebTerminal through UiFlow2 to check if the USB device is recognized. Navigate to the serial monitor and look for USB HID initialization messages.</p>
<p dir="auto">Test Hardware Connection: Ensure you're using the USB-C port (labeled as USB 2.0 OTG) on Tab5, not the USB-A host port. Try different USB cables known to work with data transfer.</p>
<p dir="auto">Simplify Test Code: Use this minimal example to isolate the issue:<br />
#include &lt;M5Unified.h&gt;<br />
#include "USB.h"<br />
#include "USBHIDKeyboard.h"</p>
<p dir="auto">USBHIDKeyboard Keyboard;</p>
<p dir="auto">void setup() {<br />
M5.begin();<br />
USB.begin();<br />
delay(2000);<br />
Keyboard.begin();<br />
M5.Lcd.print("USB HID Ready");<br />
}</p>
<p dir="auto">void loop() {<br />
M5.update();<br />
if (M5.BtnA.wasPressed()) {<br />
Keyboard.print("Hello");<br />
Keyboard.write(KEY_RETURN);<br />
}<br />
}</p>
<p dir="auto">Check Power Management: Ensure Tab5 is sufficiently powered (use external power if battery level is low). USB HID functionality may be disabled under low power conditions.</p>
<p dir="auto"><a href="https://chat.m5stack.com/" target="_blank" rel="noopener noreferrer nofollow ugc">https://chat.m5stack.com/</a></p>
]]></description><link>https://community.m5stack.com/post/29528</link><guid isPermaLink="true">https://community.m5stack.com/post/29528</guid><dc:creator><![CDATA[yuyun2000]]></dc:creator><pubDate>Thu, 17 Jul 2025 09:10:19 GMT</pubDate></item></channel></rss>