-
Notifications
You must be signed in to change notification settings - Fork 428
Incompatibility with Keyboard.h #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
What OS are you using (e.g. Windows, Linux, Mac, etc.)? If it is Linux, I know some Linux distributions include a driver that causes the joystick to be a virtual mouse (see https://ubuntuforums.org/showthread.php?t=1879616, https://bbs.archlinux.org/viewtopic.php?id=119421, https://bugs.launchpad.net/ubuntu/+source/xorg/+bug/277915, etc.). Try plugging in a standard USB joystick and see if you can reproduce the behavior. |
Are you still having this issue? |
I have the same issue with the Mouse.h library. As soon as I include both Mouse.h and Joystick.h, calling Mouse.move() with any arbitrary parameter will let my cursor jump to the bottom right corner of my screen. I just tested it under Android 5.1.1 with ARMv8 and it doesn't seem to jump. Will make a few more tests. Edit: Both mouse and joystick input work under Android |
Hi, `#include "Joystick.h" #include <Keyboard.h> Joystick_ Joystick; // Set analog axis pin // Stick values void setup() { // Initialize Button Pins // Initialize analog stick. // Initialize Joystick Library // Initialize Keyboard Library //Serial.begin(9600); void loop() { // Read pin values // Read analog stick position. // Set the actual joystick position //Serial.print ("Asse X: "); //Serial.print (", Asse Y: "); delay(50); I'm on Windows 10 64bit, Arduino 1.8.4 and using Arduino Micro board. PS: sorry for my English, not my native language |
Coding in Arduino, connecting to XBOX AC USB joystick port. Stuff I've been doing for ages -- this time, I want to also have the keyboard.h when connected to PC. The minute I add the "include keyboard.h" the XBOX AC quits recognizing it as a joystick -- even though I've not even done a .begin() on the keyboard. *** UPDATE: This is a known issues with the XBOX AC. The moment you add in a keyboard (even in include) the XBOX AC sees it as an unrecognized HID and refuses to work with it. *** |
I’d suggest using ‘bisect debugging’ to try and figure out the problem. It looks like this:
Obviously it’s not quite this simple, as the code needs to compile, so you have to choose intelligent split points. But you get the idea. If finding split points is really hard, you can invert the process. Include keyboard.h, but comment out all the lines of code. Add in code sections until the failure reoccurs. |
Ron showed me this issue earlier today. This is a problem with the XBox Adaptive Controller's USB stack. There is no (known) way around it. The USB stack will not recognize a composite device. When a composite HID device is presented, the XAC simply refuses to talk to it. This is a known issue and one that I reported to Microsoft through many channels years ago. A PDF that details the issue is here: https://github.com/adafruit/circuitpython/files/3005031/XBox.Feedback.pdf A bug for CircuitPython is also here which has more detail: adafruit/circuitpython#1696 As soon as the keyboard.h and mouse.h are both included, the USB descriptor switches to make a composite device which causes your issues. Sorry to be the bearer of bad news. |
Closing this issue since it is not an issue with the library, but with the host device. |
Uh oh!
There was an error while loading. Please reload this page.
I have not tested much and don't really know what is causing it.
I wanted my Leonardo to be both a joystick and a keyboard.
As soon as I added the
#include <Keyboard.h>
my mouse cursor was controlled by the values I was sending to the X and Y axes of the Joystick.I don't even have to call
Keyboard.begin()
.Also, the the Leonardo wasn't recognized as a joystick anymore, I think.
My guess is that some HID-magic is going wrong between the two libraries, so the values get sent as mouse axes instead of joystick axes.
Probably reproducible by running the following code:
The text was updated successfully, but these errors were encountered: