News, tips, advice, support for Windows, Office, PCs & more. Tech help. No bull. We're community supported by donations from our Plus Members, and proud of it
Home icon Home icon Home icon Email icon RSS icon
  • How to use a VM to program mice and keyboards in Linux

    Posted on Ascaris Comment on the AskWoody Lounge

    Home Forums AskWoody support Non-Windows operating systems Linux – all distros How to use a VM to program mice and keyboards in Linux

    Topic Resolution: Not a Question

    This topic contains 3 replies, has 3 voices, and was last updated by  Ascaris 2 weeks, 4 days ago.

    • Author
      Posts
    • #1986888 Reply

      Ascaris
      AskWoody_MVP

      Lots of mice and keyboards have all kinds of extra functions that go beyond what “normal” devices do.  Mice can have lots of extra buttons that can be programmed, and sometimes keyboards do too.  Some of them have lighting effects that can be programmed… all kinds of different things are possible.

      Sometimes this extra functionality is done in software.  A program has to be running at all times, listening, waiting for the extra mouse button to be pressed (as one example), at which time it will perform its programmed action, like simulating a keypress or starting a macro.

      That’s not the kind of device I’m discussing right here.  I’m referring to devices that have onboard memory to be able provide this extra function in hardware.  In hardware mode, no translation is needed; if you press the mouse button you’ve programmed to send F1, the mouse sends a F1 directly, like it was a keyboard.  In Linux, Windows, or if you plug it into a different machine, it’s still going to send F1 when that button is pressed.  You can usually also select other hardware profiles, so you can have multiple setups (for different games, programs, etc.).

      The software that programs the mouse can usually also work in the software mode as described above, and if so, it will be necessary to select the hardware mode.

      This works well for Linux users, since we can have our devices be just as useful as in Windows, even if the mouse software won’t run in Linux.  In hardware mode, the mouse software is only needed to program the mouse, but after that, it’s usable on its own, in any OS.

      It’s not hard to set up a VM to be able to program the mouse or keyboard.  First, you’ll need Windows running as a guest in a VM, using whatever software you want to use.  There are many guides out there about setting up a Windows VM under Linux.

      I use VirtualBox software to run a Windows 7 guest.  Once Windows is working in the VM, the rest is easy.  Download the mouse or keyboard software using the browser inside the VM (there are other ways to get the software in there if you already have it downloaded, but this one is the simplest).  Run the software to start the installation inside the VM, and when it asks you to plug in the device (I am assuming it’s already plugged in here), open the Devices menu, which is shown in the screenshot here, and navigate to USB, then to the name of the device you want to program.  Here, I have my K68 keyboard highlighted.

      menu

      Check the box, and you should immediately hear the Windows device connected sound.  Sometimes the device behaves erratically in the virtual Windows after this, and they won’t work outside of the VM at that point either, so you might need to have another keyboard or mouse handy (laptop users have this easy!) to use while the device you are programming is in pass-through mode.  Don’t pass through the other device, though.

      Then you can program the thing the same way as you would on a regular Windows machine.  When you are done, uncheck the box to give the device back to Linux, and your programmed functions should still work.  You can close the VM at that point (be sure to save the snapshot so you can use the mouse or keyboard program again in the future).

      Group "L" (KDE Neon User Edition 5.17.3).

      Attachments:
    • #1996932 Reply

      Rick Corbett
      AskWoody_MVP

      So, ultimately, this is about using a mouse and keyboard in VirtualBox?

      (To be honest? I have no interest. Just trying to prune the ‘Topics with no replies’ queue which has recently grown inordinately.)

      • #1997050 Reply

        Ascaris
        AskWoody_MVP

        I had mentioned that I use a Windows guest in VirtualBox to program the onboard profiles on my mouse and keyboard, and someone said they were interested in how to do that, and asked for a link to a how-to.  I didn’t have one, so I wrote this.  It doesn’t really need a reply, but now it has some anyway!

        Group "L" (KDE Neon User Edition 5.17.3).

    • #1997042 Reply

      anonymous

      When you are done, uncheck the box to give the device back to Linux, and your programmed functions should still work. You can close the VM at that point (be sure to save the snapshot so you can use the mouse or keyboard program again in the future).

      Last lines of OP, to clarify for any reader that has interest. Thanks for pruning the list.

    Please follow the -Lounge Rules- no personal attacks, no swearing, and politics/religion are relegated to the Rants forum.

    Reply To: How to use a VM to program mice and keyboards in Linux

    You can use BBCodes to format your content.
    Your account can't use Advanced BBCodes, they will be stripped before saving.