Directions ========== For conversions between different APIs, the physical behaviour should be the same. DInput ______ Extracted from http://msdn.microsoft.com/en-us/library/windows/desktop/ee417536%28v=vs.85%29.aspx : Physical situation: North (polar 0, spher[0] 270) (0, -1) -y Far West East (polar 90, spher[0] 0) (-1, 0) O (+1, 0) -x Left +x Right South (0, +1) +y Near .------. | User | '------' Remember these are the 'directions': as defined as the direction the user should exert force in to counteract the force. So the direction in which the force is applied by the joystick, is opposite. If we're interested in the direction in which the force is applied by the joystick, the physical situation becomes point-flipped: (polar 0, spher[0] 270) (0, +1) +y (polar 270, spher[0] 180) (polar 90, spher[0] 0) (+1, 0) O (-1, 0) +x -x (polar 180, spher[0] 90) (0, -1) -y Linux _____ Extracted from Linux input.h, and from ff-memless-next.txt for the cartesian coordinates : Physical situation: Up (dir 180) (0, -1) -y Left (dir 90) Right (dir 270) (-1, 0) O (+1, 0) -x +x Down (dir 0) (0, +1) +y .------. | User | '------' It is unclear what is meant by 'directions' in this case: Possibility #1: counteraction direction of user Possibility #2: direction of force applied by joystick Anssi Hannula confirmed that Possibility #2 is the right one: (http://www.mail-archive.com/linux-input@vger.kernel.org/msg08463.html) Mapping _______ In the "Carts" column, you can find the cartesian coordinates which indicate the counteraction direction of user. (This choice is arbitrary ('direction of force applied by joystick' could also have been chosen), just to have a physical reference.) These "Carts" tuples should be equal across APIs to ensure equal behaviour. #Assume Possibility #1: # # DInput <-> Linux # _________________ | ___________ # Carts|Polar|Spher | Carts|Direc # -----+-----+----- | -----+----- # 0, -1| 0 | 270 | 0, -1| 180 # +1, 0| 90 | 0 | +1, 0| 270 # 0, +1| 180 | 90 | 0, +1| 0 # -1, 0| 270 | 180 | -1, 0| 90 Assume Possibility #2: => Linux cartesian coordinates are opposite in respect to the "Carts" reference. DInput <-> Linux _________________ | ___________ Carts|Polar|Spher | Carts|Direc -----+-----+----- | -----+----- 0, -1| 0 | 270 | 0, -1| 0 +1, 0| 90 | 0 | +1, 0| 90 0, +1| 180 | 90 | 0, +1| 180 -1, 0| 270 | 180 | -1, 0| 270