Using Blender with a second USB Numpad

Hi. Here’s a long, long shot, but worth to try the post.

Why do you want to make F13-F24 new keyboard keys on your secondary USB Numpad?
Answer: Quicker animation keybinds (and modifiers assigned by shortcuts), rigging presets and bone selections… there is a plethora of uses to speed up workflow with those new keys enabled.

Ok, so you know you can manipulate blender different editors depending on your shortcut keys.
In Windows 7, 8,10+ etc. you can configure extra keyboard keys that are not physically on your keyboard, such as F13 (which is produced by using Shift+F1), F14 (produced with Shift+F2), F15 (produced with Shift+F3), F16, F17, F18, F19, F20, F21, F22, F23 and F24.
Someone in the community ran a quick python listen code, and this is what Blender returned for F13:

f13 event2
f13 event

He mentioned that Blender says that the key is “unnasigned” and there for it’s “unknown”.
Here’s where it gets complicated;
I wanted to assign a second USB Numpad key keyboard (key #1) to F13 to “FRAME FORWARD”

But the (1) Key on the second Numpad key, behaves exactly as (1) in my original typing keyboard.

You may say: Easy solve: Use a program like the old HIDMacros test the key press on your second numpad (key 1) and reassign it using this code to F13:
hid macros

but the HIDMacros doesn’t respond as F13, it still responds as Numpad1 (identifying the HID device as device 2 on Windows…) So Windows knows it’s got a secondary USB Numpad assigned. The next step is have HIDMacros detect we want to re route that keypress to F13.
The final step will actually be pushing the “shortcut key assignment in Blender” with the new rerouted Numpad 1 (F13) to make the frame go forward.

But it seems I can’t get scenario 1 working right (reassigning the numpad to F13) and scenario 2 (Blender needs to figure what key is F13) can’t be detected either.

I know accomplishing this is possible, I am just not getting the configurations correctly.

Has anyone ventured into looking how to extend HIDMacros for Blender?

Update, I remapped the secondary USB Numpad key (1) with HIDmacros like this:

Now F13, is correctly recognized in OBS.
F13 is not recognized as F13 in Blender. It’s still showing 01 Numpad. And if I press 01 on my main numpad I get the exact same behavior (in this post thread example: to go forward 1 frame).

@pKrime maybe this is something you might be experienced with?

@tin2tin @tonton maybe this is something you’ve probably look in the past? how to assign function keys from a secondary keyboard? Any pointers will help. Thanks.

AutoHotkey can recognize quite of bit codes. I use it for remapping keys.

Here’s what I got so far:

I was watching this video for reference:

Thank you. Yes, I’ve been looking into autohotkey as well, but I can’t configure the secondary USB numpad as an EXTRA device. It always recognizes it as the same Keyboard 1 numpad, no matter what I do.

The idea of an external controller is not new, check this post:

Did you use AHK’s keyboard spy app to check that?

Maybe see this part

1 Like

Ok. I solved the registry of the F13 to F24 keys using LUA macros (an updated version of HIDmacros), it’s correctly identifying the HID device.

Now my only problem is that there is NO WAY to input F13 in Blender, as it only accepts a “standard” keyboard mapping when you press “PRESS” to identify the shortcut key you’d like to associate with.

Is there a way to bypass / Extend the keypress to/ or code the F13? F24?

1 Like

Just assign a crazy unlikely combo in Blender and use AHK/LuaMacros to remap that combo to F13.

1 Like

Thank you for your replies KKar, I’ve been doing testings, and finally found the way to call the F13-F24 from within windows, to place the “press” key in Blender legitimately with a normal keyboard. I’m experimenting right now and I will posts my progress soon.
Thank you for your pointers about urls and names, it has been very useful.

1 Like

I am specifically trying to remap “frame forward” with the screen.frame_offset set to Delta 1 using CTRL+F20, triggered by Numpad 1 on my secondary usb Numpad. So far it works, but it ALSO TRIGGERS “Front ortographic view”. I don’t know how to deal with that in Blender.

Blockquote Just assign a crazy unlikely combo in Blender and use AHK/LuaMacros to remap that combo to F13.

Could you please elaborate some more, specifically with the Frame Offset case that I’m trying to modify, please?

As of right now, I have already assigned F13 to Lua to trigger Blender’s Next frame. And it works, the only problem is, that the secondary USB numpad keyboard still sends “1” (which is the bonded F13 key) to Blender, so it still puts the viewport in “front ortographic view”.
It’s doing 2 things at the same time.
Please help.

As far as I understand Lua captures F13, but you are not able to use that properly in Blender. I have not used the Lua method, I only use AHK here.

Just assign “ctrl shift alt left” to next frame in Blender. And use AHK to remap F13 to “ctrl shift alt left” Maybe you can assign F13 to “ctrl shift alt left” directly in the Lua macro. This way the mapping will trigger a key combo that is not assigned to anything in Blender, basically it will avoid conflicting key mappings.

You might also need to do double transform like Lua->Ahk-Blender mapping, if Lua method you use is independent from AHK.

Yes, this part absolutely works with LUA (alone) and HK (alone) and AHK combined with LUA.
but since Usb Numpad #1 is pressed, Blender recieves an echo (Numpad 1) and also triggers the F13, or “ctrl+shift+alt+left” or whatever remapping that has been assigned too.

So if I have my 3d view in whatever position, I press Numpad 1 in my extra USB keyboard, the viewport turns to front ortographic view and also advances 1 frame.

It’s the "echo"ing of the Numpad 1 (through 9) that still activate within Blender that’s causing this to not work correctly as expected.

This is by far the best pointer that I’ve found for LUA:

I’m attaching the scripts I’m using for AHK and LUA. Check out the video. (5.7 KB)

How to get device ID:

My progress so far (and issues with AHK):

Blender can pick up F13-F24 keys:

Ok, I finally got it solved. I passed the LUA code and the text variable code. I fixed my syntax on AHK and now it’s working. Blender reacts to F13-F24 combinations and it doesn’t conflict with regular typing keyboard numpad keys.

However Lua macros still “echoes” numpad 1, after triggering the set command. So I still get the “front orthographic view” instead of the perspective view. How can I fix that in AHK?

I guess your only option is to remap the viewport numpad shortcuts so that a keymap like numpad 1 does not trigger it.