Hello all. I’m trying to make a nice basic mouse/keyboard interface with a HID Remapper v6. I can’t work out the Expression to stop the mouse pointer zipping towards the extreme corner of the screen.
Joystick ports 2-4 work perfectly with Ultrastiks / Arduino sticks (which converts to digital on/off output).
Joystick port 1 I cannot work out how to behave like a nice mouse controller. I’ve tried everything I can think of (expressions, registers, direct, cribbing from the demos and past code etc.). I think I need two expressions, but I can’t work out the right code. Any help appreciated.
In Expression 1 and 2 you have to put a “1 port” before reading the inputs, setting the port on the mapping is not enough (the expressions are evaluated once, regardless of their use in mappings).
Also probably a good idea to use input_state_scaled instead of input_state to avoid issues with different joysticks using different ranges.
And the “0” scale in Expression 2 is probably not what you want.
Thank you, Jacek. Apologies. I had used 1 port a few times with other code, but lost it there. Your post put me on the right path. Working nicely now.
I was wondering if it’s possible to confine the joystick to mouse pointer movements to cardinal 90 degree only movements (North, East, South, West) with no diagonals. I tried again, but couldn’t work it out. Nor could Grok. Is it possible?
Thanks Jacek. That’s not working with my Ultrastik nor Arduino based sticks. East and South work well. North and West don’t respond unless you find a very narrow North+Westerly diagonal position. The movement output is restricted to 90 degree angles however. Just the response of the joystick is wrong.