Code Monkey home page Code Monkey logo

Comments (4)

dmadison avatar dmadison commented on June 8, 2024 1

Unfortunately you can't do that with this library. The USB descriptors are handled by the relevant 'boards' files and cannot be changed or overwritten on the fly.

For that matter you can't do that with the official Keyboard library either. The begin and end functions are empty. To truly 'stop' emulation you would have to disconnect from USB (physically or in software) and then re-enumerate without the keyboard descriptors present.

If you want keyboard and joystick behavior to switch off your best bet is to use the Joystick library and some sort of XInput emulation on the PC side (e.g. x360ce) if it's needed. Although the Arduino will always show up as both a keyboard and joystick simultaneously.

If you need the device to actually switch from one to the other you would have to leave the Arduino environment. You could use LUFA with an AVR Arduino (e.g. the Leonardo or Pro Micro) but you would be on your own with coding the USB descriptors and behavior. And if you're a beginner programmer that's going to be a tall task.

from arduinoxinput.

dmadison avatar dmadison commented on June 8, 2024

Unplugging the microcontroller tends to work pretty well 😛

What are you trying to accomplish?

from arduinoxinput.

dorgis16 avatar dorgis16 commented on June 8, 2024

In trying to run multiple emulator like xinput and keyboard but I want to be able to switch between them in the keyboard emulation you can start it with keyboard.begin() and stopped it with keyboard.end() but in xinput I only se a way to start

from arduinoxinput.

dorgis16 avatar dorgis16 commented on June 8, 2024

Thank for all your help I really appreciate

from arduinoxinput.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.