Alef/A2.ahk – User

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " (={2,})([^ = ])(.*)([^ = ])(={2,}) * " to " $1 $2$3$4 $5 ")
 
(8 intermediate revisions by one other user not shown)
Line 2: Line 2:
ArmA doesn't allow more than one joystick to be used in the game. And, in case you have more than one, it doesn't allow you to choose which one.
ArmA doesn't allow more than one joystick to be used in the game. And, in case you have more than one, it doesn't allow you to choose which one.
There are different solutions to this problem. Here I present mine.
There are different solutions to this problem. Here I present mine.
==PPJoy==
== PPJoy ==
PPJoy is a software that emulates a joystick. ArmA choose the joystick with more buttons, or a wheel.
[http://www.geocities.com/deonvdw/PPJoy.htm PPJoy] is a software that emulates a joystick. ArmA choose the joystick with more buttons, or a wheel.
===Configuration===
=== Configuration ===
[[Image:ALEF_PPJoy_configure_mapping_for_axes.PNG]]
[[Image:ALEF_PPJoy_configure_mapping_for_axes.PNG]]
[[Image:ALEF_PPJoy_configure_mapping_for_buttons_1.PNG]]
[[Image:ALEF_PPJoy_configure_mapping_for_buttons_1.PNG]]
[[Image:ALEF_PPJoy_configure_mapping_for_buttons_2.PNG]]
[[Image:ALEF_PPJoy_configure_mapping_for_buttons_2.PNG]]
[[Image:ALEF_PPJoy_configure_mapping_for_Pont-Of-View_Hats.PNG]]
[[Image:ALEF_PPJoy_configure_mapping_for_Pont-Of-View_Hats.PNG]]
==GlovePIE==
GlovePIE allows to mix different input devices, like keyboards, mice, joysticks, wii, trackir.
===arma.pie===
====lean with the mouse====
# press the Windows key
# press the Shift key and slide your mouse left or right.<BR>Your soldier gradually lean left or right and rotate a bit too
# let the Windows key pressed and release the Shift.<BR>He keep leaned and can rotate around
# press the Shift again.<BR>You change you lean
# release the Windows key and the Shift.<BR>Exit the lean with mouse
====code====
<pre>
// use TrackIR(tm) input
var.TRACKIR=false
// lean using the mouse, scale factor
var.MOUSE_LEAN=100
// POV digital3+ = down, up
ppjoy1.digital3=joystick1.button2
ppjoy1.digital4=joystick1.button3
ppjoy1.digital5=joystick1.button4
ppjoy1.digital6=joystick1.button5
// Joy buttons
ppjoy1.digital1=joystick1.button1
ppjoy1.digital7=joystick1.button6
ppjoy1.digital8=joystick1.button7
ppjoy1.digital13=joystick1.button1
// Tab,ShiftTab for targets
if joystick1.button8 then {
  Key.Shift=true
  Key.Tab=true
  Key.Tab=false
  Key.Shift=false
  wait 100ms
} else if joystick1.button9 then {
  Key.Tab=true
  Key.Tab=false
  wait 100ms
}
// Zoom mgmt
var.b10 = joystick1.button10 // Keep zoomed out
var.b11 = joystick1.button11 // Keep zoomed in
if var.b10 or (Key.Windows and Mouse.WheelDown) then {
  //Mouse.DirectInputZ=1
  var.z=faketrackir.z-1
  faketrackir.z=max(var.z, -1)
  wait 500ms
}
if var.b11 or (Key.Windows and Mouse.WheelUp)  then {
  //Mouse.DirectInputZ=0
  var.z=faketrackir.z+1
  faketrackir.z=min(var.z, 1)
  wait 500ms
}
// axes
ppjoy1.analog0=joystick1.x
ppjoy1.analog2=joystick1.z
// y dead 0.03 -0.18
var.y=joystick1.y
if var.y < -0.18 then {
  var.ey=EnsureMapRange(var.y, -1, -0.18 , -1, -0.01)
  ppjoy1.Analog1=var.ey
  //ppjoy1.analog1=var.y
} else if var.y > 0.03 then {
  var.ey=EnsureMapRange(var.y, 0.03 , 1, 0.01 , 1)
  ppjoy1.Analog1=var.ey
} else {
  ppjoy1.analog1=0
}
// arma always choose the wheel over ppjoy
// if (joy2.productname="Logitech G25 Racing Wheel USB")
ppjoy1.analog3=joystick2.x
ppjoy1.analog4=joystick2.y
ppjoy1.analog5=EnsureMapRange(joystick2.roll, -1, 1, -3, 3)
// FreeTrack
if var.TRACKIR then {
  faketrackir.pitch=realtrackir.pitch
  faketrackir.yaw=realtrackir.yaw
  //var.irz=EnsureMapRange(realtrackir.pitch, -5, 5, -1, 1)
}
if Key.Windows then
    if Key.Shift then {
      if (! var.in_lean) then { // initial
          var.lean_t0=mouse.DirectInputX
          var.tune_lean=false
          var.in_lean=true
      }
      if (! var.tune_lean) then {
          var.lean_t0=mouse.DirectInputX-var.lean
          var.tune_lean=true
      }
      var.lean=mouse.DirectInputX - var.lean_t0
      faketrackir.x=EnsureMapRange(var.lean, -(var.MOUSE_LEAN), var.MOUSE_LEAN, -1, 1)
    } else {
      var.tune_lean=false
    }
} else {
  faketrackir.x=0
  var.lean=0
  var.in_lean=false
}
</pre>

Latest revision as of 19:18, 31 January 2021

What is this?

ArmA doesn't allow more than one joystick to be used in the game. And, in case you have more than one, it doesn't allow you to choose which one. There are different solutions to this problem. Here I present mine.

PPJoy

PPJoy is a software that emulates a joystick. ArmA choose the joystick with more buttons, or a wheel.

Configuration

ALEF PPJoy configure mapping for axes.PNG ALEF PPJoy configure mapping for buttons 1.PNG ALEF PPJoy configure mapping for buttons 2.PNG ALEF PPJoy configure mapping for Pont-Of-View Hats.PNG