The same simple code using keyboard.h with just Keyboard.begin(); and
Keyboard.println("Hello!"); on my Arduino MKR WiFi 1010 works still well with old MacBook Pro and works with Windows 10. The code does not work with Windows 11 Home - 10.0.22631 Build 22631. The issue = no keyboard activity is shown on Windows 11 side which is connected to Arduino with USB cable.
Has anybody debugged the keyboard package with Windows 11 to root cause the issue?
Is there a way to get keyboard.h working with Windows 11?
Welcome! Not a clue as to how this stuff is connected. What code are you talking about, the Arduino code or the Windows code. Posting A simple schematic and your code would help us help you. Be sure to follow the forum guide lines and use code tags.
It is hard to tell whether this is Windows 11 code issue or Arduino library issue or them just not working properly together. More clarifications below.
A. The way my code is connected is as follows:
The Arduino MKR WiFi 1010 is emulating keyboard towards Windows or Mac PC and is used to control Spotify and YouTube with keyboard shortcuts. It is currently used by a person who is paralyzed and can only use pressure sensor whose input my system converts to keyboard shortcuts e.g. space bar for playing and pausing playback, shift+n to jump to next etc.
USB is used for the connection
B. Problem = No data is being sent to PC. Please note that exactly the same SW works super well with Windows 10. It also works now against Mac. I will do some debugging today to get more info.
C. Example code that works on Mac now, works on PC with Windows 10 now but does not work with Windows 11
the following code is just keyboard.h example for using Keyboard.h straight from the library. I have used it to test the issue with this isolated super simple code.
#include <Keyboard.h>
void setup() {
// make pin 2 an input and turn on the
// pullup resistor so it goes high unless
// connected to ground:
pinMode(2, INPUT_PULLUP);
Keyboard.begin();
}
void loop() {
//if the button is pressed
if (digitalRead(2) == LOW) {
//Send the message
Keyboard.println("Hello!");
}
}
The fact that it works on two other machines indicates it is probably the third machine that is the problem. I am not a windoz guy but it sounds like it is missing a driver.
The arduino should appear as a USB keyboard to the computer, may be a driver problem. Does a regular wired USB keyboard work on the windows 11 computer?