Parameters for ActionID = HIDMouse_Wheel ?

Post questions, comments and feedback to our 3Dconnexion Windows Development Team.

Moderator: Moderators

Post Reply
wilco
Posts: 16
Joined: Tue Oct 21, 2025 2:36 am

Parameters for ActionID = HIDMouse_Wheel ?

Post by wilco »

I have mapped HIDMultiAxis_Rz to HIDMouse_Wheel for mouse wheel scrolling using 3Dmouse yaw (opening a jar motion) as per the XML code below.

To have keyboard and mouse events work over Remote Desktop I needed to add <KMJMechanism>SendInput to global.cfg . Unfortunately this setting has made the HIDMouse_Wheel events too fast. (It works fine locally when I don't use SendInput mode

How can I slow down ActionHIDMouse_Wheel?

1. Scale: Without SendInput mode, Scale=0.x works well. After SendInput mode, Scale has no effect with values larger than >0.001 , and at 0.001 it stops working entirely.

2. Pause: Can I set it up as a sequence and use Pause? Can I split the Rz axis into positive/negative and send MouseWheelUp and MouseWheelDown commands with Pause commands in between? What are the XML values to send the equivalent of MouseWheelUp and MouseWheelDown?

3. MaxEventRate: No effect.

4. What are the parameters for <ActionID>HIDMouse_Wheel exactly?

Code: Select all

 <Input>
            <ActionID>HIDMultiAxis_Rz</ActionID>
            <Min>-512</Min>
            <Max>512</Max>
            <Deadband>80</Deadband>
          </Input>
          <Output>
            <ActionID>HIDMouse_Wheel</ActionID>
            <Reversed>true</Reversed>
          </Output>
jwick
Moderator
Moderator
Posts: 3455
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Parameters for ActionID = HIDMouse_Wheel ?

Post by jwick »

It's the first I've seen this request. Though it is valid.
There are no parameters to set the rate of those events. They are sent at the rate they are received.
You would need to write code using the driver's extension mechanism.
wilco
Posts: 16
Joined: Tue Oct 21, 2025 2:36 am

Re: Parameters for ActionID = HIDMouse_Wheel ?

Post by wilco »

I agree it's unique because Scale works perfectly when run locally; it's some quirk that just affects Remote Desktop.

My suggestion would be to add single tick of MouseWheelUp and MouseWheelDown as discrete events to the list of shortcuts in the GUI - then in XML it this could be handled with something like RepeatStyle and MaxEventRate (possibly - some reference here) It would be useful to easily bind these wheel events to buttons as well.

I'm not sure if MaxEventRate just applies to KB_Keystroke or could also be used for this theoretical HIDMouse_Wheel_Up function I'm proposing. (Afaik there is no pre-existing HID hex code I could put into KB_Keystroke to emulate a discrete wheel up/down event.)

For the custom approach I'm trying to work back from your solution here for a pathology slide viewer:

Code: Select all

    <AxisAction Type="DLL">
      <ID>Dll_Zoom_HiRes</ID>
      <Name>Zoom</Name>
      <Executable>WPPZ.DLL</Executable>
      <Function>Zoom_HiRes</Function>
      <Arg>HIDID</Arg>
    </AxisAction>
And then under Output:

Code: Select all

     <ActionID>Dll_Zoom_HiRes</ActionID>
        <NameID>STR_PAN_UP_DOWN</NameID>
        <Min>-512.0000</Min>
        <Max>511.0000</Max>
        <Scale>0.7500</Scale>
        <Reversed>false</Reversed>
      </Output>
Is there any calls in your WPPZ.dll I could use rather than roll my own?
wilco
Posts: 16
Joined: Tue Oct 21, 2025 2:36 am

Re: Parameters for ActionID = HIDMouse_Wheel ?

Post by wilco »

Screenshot 2025-10-29 004718.jpg
Screenshot 2025-10-29 004718.jpg (59.16 KiB) Viewed 464 times
jwick
Moderator
Moderator
Posts: 3455
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Parameters for ActionID = HIDMouse_Wheel ?

Post by jwick »

WPPZ was an interesting idea. There are two Zoom() exported functions that send MouseWheel events. The one you referenced above and a regular Zoom(). If I read my code correctly, one is very fast (100Hz), and the other is fast (60Hz - which is the standard device rate). Neither one gives you control over the rate.
I think you need to roll your own using SendInput().
I do like the idea of having more rate control. I obviously needed to add it for KB events.
wilco
Posts: 16
Joined: Tue Oct 21, 2025 2:36 am

Re: Parameters for ActionID = HIDMouse_Wheel ?

Post by wilco »

I wrote a quick x64 DLL in C but can't get it to load in 3DxWare, I put it in the correct folder and get log error:
UdDllExecuteFunction: Could not find DLLList Entry for wmtool.dll

When I use your WPPZ.dll it works fine so it's something with my dll. I checked it's x64, exported function name is OK. I paste my short DLL code below for interest.

Could you please send me the code you have for WPPZ?

Code: Select all

#include <windows.h>
#include <cmath>
#pragma comment(lib, "user32.lib")

extern "C" {

// Sends a single mouse wheel input event
void SendMouseWheel(int delta)
{
    INPUT input = {0};
    input.type = INPUT_MOUSE;
    input.mi.mouseData = delta;
    input.mi.dwFlags = MOUSEEVENTF_WHEEL;
    SendInput(1, &input, sizeof(INPUT));
}

// Exported function: to be called by 3Dconnexion
extern "C" __declspec(dllexport) void __stdcall MouseWheelMove(int deflection)
{
// Set scale here
    constexpr double scale = 1.0;
    int scroll = static_cast<int>(std::round(deflection * (WHEEL_DELTA / 512.0) * scale));

    if (scroll != 0)
        SendMouseWheel(scroll);
}

} // extern "C"

BOOL APIENTRY DllMain(HMODULE, DWORD, LPVOID)
{
    return TRUE;
}
wilco
Posts: 16
Joined: Tue Oct 21, 2025 2:36 am

Re: Parameters for ActionID = HIDMouse_Wheel ?

Post by wilco »

Update: I get the same error UdDllExecuteFunction: Could not find DLLList Entry for XYZ.DLL
even when trying to use any of the other default DLL files that were in the directory
C:\Program Files\3Dconnexion\3DxWare\3DxWinCore\Win64\DLLs

I get the same error when using the simple test.dll file from your post here.

But it still works for WPPZ.dll - no problems. Doesn't like any other DLL. Strange.
jwick
Moderator
Moderator
Posts: 3455
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Parameters for ActionID = HIDMouse_Wheel ?

Post by jwick »

That LogMessage is from trying to find the DLL to execute your function. It scans the cfg file to see what DLLs are used by it, then loads them into a list.
It probably didn't load the DLL. Hopefully there is a LogMessage about what the problem was.

Email your DLL src to me and the cfg file that tries to use it.
It might also be expecting some boilerplate in the DLL, that I added after those old posts.
jwick
Moderator
Moderator
Posts: 3455
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Parameters for ActionID = HIDMouse_Wheel ?

Post by jwick »

You should have seen a LogMessage about this.
00000001 30/10/2025 8:42:1.186: LoadDLL: Error 0x7f trying to run function: TESTER.DLL:DllInit
(Not that that gives you enough information to use)

Add these to your DLL:

Code: Select all

// DLL Initialization function.  
// This gives you a chance to do any one time initialization immediately after this DLL is loaded.
// It is called immediately after the DllMain is called (which is called during LoadLibrary).
// Return anything other than ERROR_SUCCESS causes this DLL to be unloaded (w/o calling DllExit).
extern "C" __declspec(dllexport) LRESULT DllInit (LPVOID lpReserved)
{
	UdCfgDLLProcessInfo* pi = (UdCfgDLLProcessInfo*)lpReserved;
	return ERROR_SUCCESS;
}

// DLL Termination function.  
// This gives you a chance to do some cleanup immediately before this DLL is unloaded.
// Return anything other than ERROR_SUCCESS causes an error to be logged, but the DLL is unloaded anyway.
// This function is not called if DllInit returns non-ERROR_SUCCESS.
extern "C" __declspec(dllexport) LRESULT DllExit (LPVOID lpReserved)
{
	LogMessage(L"DllExit called\n");
	return ERROR_SUCCESS;
}
wilco
Posts: 16
Joined: Tue Oct 21, 2025 2:36 am

Re: Parameters for ActionID = HIDMouse_Wheel ?

Post by wilco »

It works now, thank you!
DllInit and DllExit did the trick.
jwick
Moderator
Moderator
Posts: 3455
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Parameters for ActionID = HIDMouse_Wheel ?

Post by jwick »

Terrific. You can specify different names (in the cfg file), but those are the default names it looks for.
wilco
Posts: 16
Joined: Tue Oct 21, 2025 2:36 am

Re: Parameters for ActionID = HIDMouse_Wheel ?

Post by wilco »

I wonder if this is the mouse scroll wheel to 3dkey button mapping I'm looking for?
Looks like scroll up, scroll down, increment, count (1 tick ie wheel_delta 120 ?)

Code: Select all

  <ButtonActions xmlns:driver_images="./images/3DxService/">
    <ButtonAction Type="MotionMacro" xsi:type="ButtonAction_MotionMacro">
      <ID>MotionMacro_Wheel_20_In</ID>
      <Name>Quick Wheel 20 In</Name>
      <Event>WM_MOUSEWHEEL</Event>
      <Increment>1</Increment>
      <Count>20</Count>
      <Sleep>10</Sleep>
    </ButtonAction>

    <ButtonAction Type="MotionMacro" xsi:type="ButtonAction_MotionMacro">
      <ID>MotionMacro_Wheel_20_Out</ID>
      <Name>Quick Wheel 20 Out</Name>
      <Event>WM_MOUSEWHEEL</Event>
      <Increment>-1</Increment>
      <Count>20</Count>
      <Sleep>10</Sleep>
    </ButtonAction>
  </ButtonActions>
jwick
Moderator
Moderator
Posts: 3455
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Parameters for ActionID = HIDMouse_Wheel ?

Post by jwick »

That does send events, via SendInput if you tell it that.
But you can only activate it from a Button push, or a radial menu button, not an axis event.
Post Reply