• Captain Aggravated
    link
    fedilink
    English
    arrow-up
    22
    ·
    4 months ago

    I actually know how to do this off the top of my head and you don’t need to write a driver for it, you could simply use an Arduino Micro.

    The Micro (and other Arduino-compatible Atmel ATMEGA 32u4-based microcontrollers) have native USB support so they have a library you can import that will work with generic USB keyboard/mouse drivers. It would be up to you to rig up the sensors and buttons, make a case and write a little firmware.

    • Aceticon@lemmy.world
      link
      fedilink
      English
      arrow-up
      3
      ·
      edit-2
      4 months ago

      Coming from the same side as you, in my experience just about any microcontroller that includes USB hardware support (which is very common even in the stupidly cheap ones) has software support for acting as a mouse or keyboard, not just via the Arduino framework but also in the manufacturer’s libraries.

      This is because the comms for that stuff in USB is an USB standard called USB HID (stands for Human Interface Device) which works not just for mice and keyboards but also for stuff like joysticks, game controllers and so on.

      Meanwhile on the computer side, also because of all of this being standardized, support comes include in the OS and no drivers are needed. In fact even back in Windows 7 when you might need to install a driver, all that the “driver” was, was a text file telling the OS to, for a USB device with a specific ID (USB devices identify themselves using a two number code), use the OS’ built-in USB HID support.

      Nowadays the difficult part in making a good mouse or a keyboard is the mechanical side, not the hardware or software.

      Unsurprisingly you can buy a basic mouse for 2 bucks from places like Aliexpress that’s actually decent and reliable.

      I really have no clue how Logitech expects to get away with this idea of theirs. Maybe they intend to leverage Brand loyalty for it?

      • Captain Aggravated
        link
        fedilink
        English
        arrow-up
        2
        ·
        4 months ago

        Yeah what Arduino brings to the table is easily purchasable electronics and reference material/tutorials written for middle schoolers and not electrical engineers to understand. They invent basically nothing but make things more accessible.

        The thing I would need to do the most googling on is the actual XY sensor. I don’t know off the top of my head how available an optical mouse sensor is, or if you’d have to build a ball mouse, etc. I have occasionally played with USB HIDs but never for anything legitimate.