Menu

How to enable / disable physical imput axes if button is pressed

Ariel Dall
2018-04-10
2018-04-12
  • Ariel Dall

    Ariel Dall - 2018-04-10

    vJoy drivers and this application are great!!! but after a lot of test I can´t find the right configuration for my needs.

    How can I disable/enable mouse X axis imput/binding only meanwhile I press a keyborad key?
    I'd tried playing with "boolean devices" and weird binding rules trying to build "conditional binding"; but I can't make the magic...

    There is some advanced function or trick to make this happen?

    If you insterested to better understand the scenario...
    I want to use this tool to generate a vJoy Z axis combining an actual physical joy RZ (logitech 3D PRO twist) plus mouse X axis for "fine tuning".
    The twist is not a precise input way.
    But the mouse itself is also used for "mouse-look" or other functions. Finally, I want to control with a button hold when the mouse X axis affects the vJox Z axis.

    Thanks in advance...

     
  • VIRTUAL

    VIRTUAL - 2018-04-12

    Your task give me a challenge. In first look it seems easy. Next near impossible. And at end (using forbidden arts) I solve it!

    UB = Upper Border
    LB = Lower Border
    X  = Custom parameter
    

    Return Values of Boolean Device (Input Value)

    IF(A>B)  C=A-B
    IF(A<B)  C=B-A
    IF(A=B)  C=1
    IF(A!=B) C=0
    

    Math Model for Range Control of value X
    IF(X<UB)AND(X>LB) THEN vJoy.X = X

    Transform

    IF(X<UB) Y = UB - X
    IF(X>LB) ....
    IF(X-UB>LB-UB) ...
    IF(UB-X<UB-LB) ...
    IF(Y<UB-LB) Z = UB - LB - Y = UB - LB - UB + X = X - LB
    IF(X>0) ...
    IF(X-LB>-LB) ...
    IF(Z>-LB) R = Z + LB = X - LB + LB = X
    IF(X<0) ...
    IF(X-LB<-LB) ...
    IF(Z<-LB) R = -LB - Z = -LB - X + LB = -X
    IF(X=0) ...
    IF(X-LB=-LB) ...
    IF(Z=-LB) R = 0
    

    Result

    IF(X<UB) Y = UB - X
    IF(Y<UB-LB) Z = X - LB
    IF(Z>-LB) R = X
    IF(Z<-LB) R = -X
    IF(Z=-LB) R = 0
    

    Recommend to use UB = 1000, LB = -1000

    Start values of Boolean Devices:

    BDev1: Operand1 = 0, Operand2 = UB (1000)
    BDev2: Operand1 = 0, Operand2 = UB-LB (2000)
    BDev3: Operand1 = 0, Operand2 = -LB (1000)
    

    Sample Binds:

    //  X = MOUSE.X_Speed
    MOUSE.X_Speed [Change] => BDev1.Operand1 [InputSet] 100% 
    
    //  IF(X<UB) Y = UB - X   
    BDev1.CResult [Less] => BDev2.Operand1 [InputSet] 100% 
    
    //  IF(Y<UB-LB) Z = X - LB     
    BDev2.CResult [Less] => BDev3.Operand1 [InputSet] 100%  
    
    //  IF(Z>-LB) R = X    
    BDev3.CResult [Greater] => vJoy.X [InputSet] 100%  
    
    //  IF(Z<-LB) R = -X         
    BDev3.CResult [Less] => vJoy.X [InputSet] 100%   
    
    //  IF(Z=-LB) R = 0           
    BDev3.CResult [Equal] => vJoy.X [Release]    
    
    //  Turn OFF chain "Mouse.X_Speed to vJoy.X"               
    Keyboard.Button_F1 [Press] => BDev1.Operand2 [Set] 0        
    Keyboard.Button_F1 [Press] => BDev2.Operand2 [Set] 0
    
    //  Turn ON chain "Mouse.X_Speed to vJoy.X"
    Keyboard.Button_F2 [Press] => BDev1.Operand2 [Set] 1000     
    Keyboard.Button_F2 [Press] => BDev2.Operand2 [Set] 2000
    
     

    Last edit: VIRTUAL 2018-04-12
  • Ariel Dall

    Ariel Dall - 2018-04-12

    Brillant!!!! you made hard work here! Thank you a lot for that.
    Finally yesterday I also found a config too and I was testing with success by now. I will test your config too!

    I figure out to use not one but two boolean devices, playing with operand values to control one "axis direction" each.

    I think you find a similar idea in your config. I will try you config to understand it better and test if shows "better binding quality".

    By the moment I see the diference that you use a pair of buttons to enable/disable the mouse binding. I played with press/release the same button to enable/disable, also combined with other real joy axis and, when you release the "enabling button", auto center the vjoy axis ( because when I combine mouse the with other phys axis could miss the vAxis center easily)

    Version = 4177
    Count = 11
    Bind0.Input.Device.Number = 0
    Bind0.Input.Device.DeviceType = 0
    Bind0.Input.Device.Name = "Keyboard WM"
    Bind0.Input.Control = 0
    Bind0.Input.Modifier = 0
    Bind0.Input.Number = 119
    Bind0.Output.Device.Number = 1
    Bind0.Output.Device.DeviceType = 253
    Bind0.Output.Device.Name = "Boolean Device 1"
    Bind0.Output.Control = 3
    Bind0.Output.Modifier = 20
    Bind0.Output.Number = 0
    Bind0.Output.Value1 = 0.02
    Bind0.Output.Value2 = 0
    Bind1.Input.Device.Number = 0
    Bind1.Input.Device.DeviceType = 0
    Bind1.Input.Device.Name = "Keyboard WM"
    Bind1.Input.Control = 0
    Bind1.Input.Modifier = 0
    Bind1.Input.Number = 119
    Bind1.Output.Device.Number = 2
    Bind1.Output.Device.DeviceType = 253
    Bind1.Output.Device.Name = "Boolean Device 2"
    Bind1.Output.Control = 3
    Bind1.Output.Modifier = 20
    Bind1.Output.Number = 0
    Bind1.Output.Value1 = 0.02
    Bind1.Output.Value2 = 0
    Bind2.Input.Device.Number = 0
    Bind2.Input.Device.DeviceType = 0
    Bind2.Input.Device.Name = "Keyboard WM"
    Bind2.Input.Control = 0
    Bind2.Input.Modifier = 252
    Bind2.Input.Number = 119
    Bind2.Output.Device.Number = 1
    Bind2.Output.Device.DeviceType = 253
    Bind2.Output.Device.Name = "Boolean Device 1"
    Bind2.Output.Control = 3
    Bind2.Output.Modifier = 20
    Bind2.Output.Number = 0
    Bind2.Output.Value1 = 0
    Bind2.Output.Value2 = 0
    Bind3.Input.Device.Number = 0
    Bind3.Input.Device.DeviceType = 0
    Bind3.Input.Device.Name = "Keyboard WM"
    Bind3.Input.Control = 0
    Bind3.Input.Modifier = 252
    Bind3.Input.Number = 119
    Bind3.Output.Device.Number = 2
    Bind3.Output.Device.DeviceType = 253
    Bind3.Output.Device.Name = "Boolean Device 2"
    Bind3.Output.Control = 3
    Bind3.Output.Modifier = 20
    Bind3.Output.Number = 0
    Bind3.Output.Value1 = 0
    Bind3.Output.Value2 = 0
    Bind4.Input.Device.Number = 0
    Bind4.Input.Device.DeviceType = 0
    Bind4.Input.Device.Name = "Keyboard WM"
    Bind4.Input.Control = 0
    Bind4.Input.Modifier = 252
    Bind4.Input.Number = 119
    Bind4.Output.Device.Number = 1
    Bind4.Output.Device.DeviceType = 3
    Bind4.Output.Device.Name = "vJoy 1"
    Bind4.Output.Control = 1
    Bind4.Output.Modifier = 20
    Bind4.Output.Number = 50
    Bind4.Output.Value1 = 0.5
    Bind4.Output.Value2 = 0
    Bind5.Input.Device.Number = 0
    Bind5.Input.Device.DeviceType = 1
    Bind5.Input.Device.Name = "Mouse WM"
    Bind5.Input.Control = 1
    Bind5.Input.Modifier = 21
    Bind5.Input.Number = 48
    Bind5.Output.Device.Number = 1
    Bind5.Output.Device.DeviceType = 253
    Bind5.Output.Device.Name = "Boolean Device 1"
    Bind5.Output.Control = 3
    Bind5.Output.Modifier = 20
    Bind5.Output.Number = 1
    Bind5.Output.Value1 = 0.01
    Bind5.Output.Value2 = 0
    Bind6.Input.Device.Number = 0
    Bind6.Input.Device.DeviceType = 1
    Bind6.Input.Device.Name = "Mouse WM"
    Bind6.Input.Control = 1
    Bind6.Input.Modifier = 22
    Bind6.Input.Number = 48
    Bind6.Output.Device.Number = 2
    Bind6.Output.Device.DeviceType = 253
    Bind6.Output.Device.Name = "Boolean Device 2"
    Bind6.Output.Control = 3
    Bind6.Output.Modifier = 20
    Bind6.Output.Number = 1
    Bind6.Output.Value1 = 0.01
    Bind6.Output.Value2 = 0
    Bind7.Input.Device.Number = 1
    Bind7.Input.Device.DeviceType = 253
    Bind7.Input.Device.Name = "Boolean Device 1"
    Bind7.Input.Control = 3
    Bind7.Input.Modifier = 34
    Bind7.Input.Number = 0
    Bind7.Output.Device.Number = 1
    Bind7.Output.Device.DeviceType = 3
    Bind7.Output.Device.Name = "vJoy 1"
    Bind7.Output.Control = 1
    Bind7.Output.Modifier = 21
    Bind7.Output.Number = 50
    Bind7.Output.Value1 = 0.0005
    Bind7.Output.Value2 = 0
    Bind8.Input.Device.Number = 2
    Bind8.Input.Device.DeviceType = 253
    Bind8.Input.Device.Name = "Boolean Device 2"
    Bind8.Input.Control = 3
    Bind8.Input.Modifier = 34
    Bind8.Input.Number = 0
    Bind8.Output.Device.Number = 1
    Bind8.Output.Device.DeviceType = 3
    Bind8.Output.Device.Name = "vJoy 1"
    Bind8.Output.Control = 1
    Bind8.Output.Modifier = 22
    Bind8.Output.Number = 50
    Bind8.Output.Value1 = 0.0005
    Bind8.Output.Value2 = 0
    Bind9.Input.Device.Number = 1290418636727870481
    Bind9.Input.Device.DeviceType = 2
    Bind9.Input.Device.Name = "(11E87CE9C5B56411) Logitech Extreme 3D"
    Bind9.Input.Control = 1
    Bind9.Input.Modifier = 21
    Bind9.Input.Number = 53
    Bind9.Output.Device.Number = 1
    Bind9.Output.Device.DeviceType = 3
    Bind9.Output.Device.Name = "vJoy 1"
    Bind9.Output.Control = 1
    Bind9.Output.Modifier = 26
    Bind9.Output.Number = 50
    Bind9.Output.Value1 = 1
    Bind9.Output.Value2 = 0
    Bind10.Input.Device.Number = 1290418636727870481
    Bind10.Input.Device.DeviceType = 2
    Bind10.Input.Device.Name = "(11E87CE9C5B56411) Logitech Extreme 3D"
    Bind10.Input.Control = 1
    Bind10.Input.Modifier = 22
    Bind10.Input.Number = 53
    Bind10.Output.Device.Number = 1
    Bind10.Output.Device.DeviceType = 3
    Bind10.Output.Device.Name = "vJoy 1"
    Bind10.Output.Control = 1
    Bind10.Output.Modifier = 27
    Bind10.Output.Number = 50
    Bind10.Output.Value1 = 1
    Bind10.Output.Value2 = 0Version = 4177
    Count = 11
    Bind0.Input.Device.Number = 0
    Bind0.Input.Device.DeviceType = 0
    Bind0.Input.Device.Name = "Keyboard WM"
    Bind0.Input.Control = 0
    Bind0.Input.Modifier = 0
    Bind0.Input.Number = 119
    Bind0.Output.Device.Number = 1
    Bind0.Output.Device.DeviceType = 253
    Bind0.Output.Device.Name = "Boolean Device 1"
    Bind0.Output.Control = 3
    Bind0.Output.Modifier = 20
    Bind0.Output.Number = 0
    Bind0.Output.Value1 = 0.02
    Bind0.Output.Value2 = 0
    Bind1.Input.Device.Number = 0
    Bind1.Input.Device.DeviceType = 0
    Bind1.Input.Device.Name = "Keyboard WM"
    Bind1.Input.Control = 0
    Bind1.Input.Modifier = 0
    Bind1.Input.Number = 119
    Bind1.Output.Device.Number = 2
    Bind1.Output.Device.DeviceType = 253
    Bind1.Output.Device.Name = "Boolean Device 2"
    Bind1.Output.Control = 3
    Bind1.Output.Modifier = 20
    Bind1.Output.Number = 0
    Bind1.Output.Value1 = 0.02
    Bind1.Output.Value2 = 0
    Bind2.Input.Device.Number = 0
    Bind2.Input.Device.DeviceType = 0
    Bind2.Input.Device.Name = "Keyboard WM"
    Bind2.Input.Control = 0
    Bind2.Input.Modifier = 252
    Bind2.Input.Number = 119
    Bind2.Output.Device.Number = 1
    Bind2.Output.Device.DeviceType = 253
    Bind2.Output.Device.Name = "Boolean Device 1"
    Bind2.Output.Control = 3
    Bind2.Output.Modifier = 20
    Bind2.Output.Number = 0
    Bind2.Output.Value1 = 0
    Bind2.Output.Value2 = 0
    Bind3.Input.Device.Number = 0
    Bind3.Input.Device.DeviceType = 0
    Bind3.Input.Device.Name = "Keyboard WM"
    Bind3.Input.Control = 0
    Bind3.Input.Modifier = 252
    Bind3.Input.Number = 119
    Bind3.Output.Device.Number = 2
    Bind3.Output.Device.DeviceType = 253
    Bind3.Output.Device.Name = "Boolean Device 2"
    Bind3.Output.Control = 3
    Bind3.Output.Modifier = 20
    Bind3.Output.Number = 0
    Bind3.Output.Value1 = 0
    Bind3.Output.Value2 = 0
    Bind4.Input.Device.Number = 0
    Bind4.Input.Device.DeviceType = 0
    Bind4.Input.Device.Name = "Keyboard WM"
    Bind4.Input.Control = 0
    Bind4.Input.Modifier = 252
    Bind4.Input.Number = 119
    Bind4.Output.Device.Number = 1
    Bind4.Output.Device.DeviceType = 3
    Bind4.Output.Device.Name = "vJoy 1"
    Bind4.Output.Control = 1
    Bind4.Output.Modifier = 20
    Bind4.Output.Number = 50
    Bind4.Output.Value1 = 0.5
    Bind4.Output.Value2 = 0
    Bind5.Input.Device.Number = 0
    Bind5.Input.Device.DeviceType = 1
    Bind5.Input.Device.Name = "Mouse WM"
    Bind5.Input.Control = 1
    Bind5.Input.Modifier = 21
    Bind5.Input.Number = 48
    Bind5.Output.Device.Number = 1
    Bind5.Output.Device.DeviceType = 253
    Bind5.Output.Device.Name = "Boolean Device 1"
    Bind5.Output.Control = 3
    Bind5.Output.Modifier = 20
    Bind5.Output.Number = 1
    Bind5.Output.Value1 = 0.01
    Bind5.Output.Value2 = 0
    Bind6.Input.Device.Number = 0
    Bind6.Input.Device.DeviceType = 1
    Bind6.Input.Device.Name = "Mouse WM"
    Bind6.Input.Control = 1
    Bind6.Input.Modifier = 22
    Bind6.Input.Number = 48
    Bind6.Output.Device.Number = 2
    Bind6.Output.Device.DeviceType = 253
    Bind6.Output.Device.Name = "Boolean Device 2"
    Bind6.Output.Control = 3
    Bind6.Output.Modifier = 20
    Bind6.Output.Number = 1
    Bind6.Output.Value1 = 0.01
    Bind6.Output.Value2 = 0
    Bind7.Input.Device.Number = 1
    Bind7.Input.Device.DeviceType = 253
    Bind7.Input.Device.Name = "Boolean Device 1"
    Bind7.Input.Control = 3
    Bind7.Input.Modifier = 34
    Bind7.Input.Number = 0
    Bind7.Output.Device.Number = 1
    Bind7.Output.Device.DeviceType = 3
    Bind7.Output.Device.Name = "vJoy 1"
    Bind7.Output.Control = 1
    Bind7.Output.Modifier = 21
    Bind7.Output.Number = 50
    Bind7.Output.Value1 = 0.0005
    Bind7.Output.Value2 = 0
    Bind8.Input.Device.Number = 2
    Bind8.Input.Device.DeviceType = 253
    Bind8.Input.Device.Name = "Boolean Device 2"
    Bind8.Input.Control = 3
    Bind8.Input.Modifier = 34
    Bind8.Input.Number = 0
    Bind8.Output.Device.Number = 1
    Bind8.Output.Device.DeviceType = 3
    Bind8.Output.Device.Name = "vJoy 1"
    Bind8.Output.Control = 1
    Bind8.Output.Modifier = 22
    Bind8.Output.Number = 50
    Bind8.Output.Value1 = 0.0005
    Bind8.Output.Value2 = 0
    Bind9.Input.Device.Number = 1290418636727870481
    Bind9.Input.Device.DeviceType = 2
    Bind9.Input.Device.Name = "(11E87CE9C5B56411) Logitech Extreme 3D"
    Bind9.Input.Control = 1
    Bind9.Input.Modifier = 21
    Bind9.Input.Number = 53
    Bind9.Output.Device.Number = 1
    Bind9.Output.Device.DeviceType = 3
    Bind9.Output.Device.Name = "vJoy 1"
    Bind9.Output.Control = 1
    Bind9.Output.Modifier = 26
    Bind9.Output.Number = 50
    Bind9.Output.Value1 = 1
    Bind9.Output.Value2 = 0
    Bind10.Input.Device.Number = 1290418636727870481
    Bind10.Input.Device.DeviceType = 2
    Bind10.Input.Device.Name = "(11E87CE9C5B56411) Logitech Extreme 3D"
    Bind10.Input.Control = 1
    Bind10.Input.Modifier = 22
    Bind10.Input.Number = 53
    Bind10.Output.Device.Number = 1
    Bind10.Output.Device.DeviceType = 3
    Bind10.Output.Device.Name = "vJoy 1"
    Bind10.Output.Control = 1
    Bind10.Output.Modifier = 27
    Bind10.Output.Number = 50
    Bind10.Output.Value1 = 1
    Bind10.Output.Value2 = 0

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.