Identifying HID devices (A second USB Numpad)

Hi. I’ve been looking for a solution for the following issue:
Context:
When you have your typing keyboard, Blender recognizes the numpad in it by default.
Thus, Numpad 1 (on the typing keyboard) focus the camera to front cartographic view (default behavior).

When you attach a secondary USB numpad to your PC, a new HID device is recognized in Windows,
and the numpad works mirroring as if it were the Typing Keyboard numpad (default expected behavior).

Problem:
Is it possible for Blender to tell apart which is the Typing Keyboard NUMPAD and which is the
additional USB Numpad via Python?
Currently, any extra USB numpad (or typing keyboard) connected to the PC drives Blender doing the
same functions than your main typing keyboard (expected behavior). What we want is to use those
extra devices like a BUTTON PRESET CONSOLE.
(please, do not mix ideas with OSC or MIDI, this has NOTHING to do with those devices or such workflows)

USAGE
Why would you want to recognize additional X numbers of physical USB Numpads (or more typing keyboards) with Blender?

  • Macros ( you can create custom commands to activate Blender functions outside of your typing
    keyboard), in this way you can have your regular Blender commands intact, but have a separate
    keyboard to do extra commands (i.e. preset trigger “Custom user preset”: vertical renders 1080x1920 at 50%)

  • Dedicated hardware to trigger drivers and controls for rigging. (i.e: Numpad 1 on the secondary USB
    keyboard, triggers: Action pose A from Quick favorites)

Blender is able to recognize CPU and GPU, and I would believe it is possible to show additional USB hardware (in our case the USB generic numpad) and show it as a HID available in Blender and that
Blender can tell apart which key is being pushed from which keyboard for the benefits mentioned above.

Researching about HID recognition in Python, I found out this:
https://python.hotexamples.com/examples/hid/-/device/python-device-function-examples.html

Recognizing different human input devices (HID) could allow us to have a fully “custom-console
Blender” with ordinary hardware. Recognizing VR devices is already possible.
Maybe this is something that could take shape in the next Blender release?

No the event stack (currently) does not keep track of the origin of a key event, if you wanted to extend that functionality intern\ghost\intern\GHOST_EventKey.h be a good starting point to start looking.

2 Likes

Thank you for your reply. Every help is appreciated on this topic. I find it marvelous that Blender can detect 3d mouses so that means there is a way to identify HID by hardware. The same goes for CPU and GPU models recognized correctly.

Can see the benefit of mapping keyboard command combinations to a secondary input device. Was a time when flying Avid editing and earlier with music notation software which had a dedicated input device that once you got the nag of it worked a treat.

Here is a link to how gamers approach this… and a good site for keyboards & keypads.

No guarantee any of this will work for your needs, but what the heck some great history there :slight_smile:

While I’ve also considered the hardware custom programability part for controlling Blender (I’m looking at you Penclic N3 numpad and ShuttleXpress) , not everyone could afford or find customizable dedicated hardware. Some solutions go up to $80+ for custom (every key) programmable.

This is why I figured it’s cheaper to invest in 3 Usb Numpads and have them mapped into Blender for custom commands. But let’s start with 1. Simply identifying this Usb HID is more than enough for anyone to start.