Processing Ajax...

Title

Message

Confirm

Confirm

Confirm

Confirm

Are you sure you want to delete this item?

Confirm

Are you sure you want to delete this item?

User Image
the dude22
9 discussion posts
I've been using a similar program that allows you to convert mouse movements to key presses. For example, with driving games if I wanted to use the mouse to steer I could use this script and just say " driving mode" to toggle it.
if said(" driving mode") then
var.mouse ++
wait 2s
endif

if var.mouse > 1 then
var.mouse = 0
Say("Mouse Unlocked")
endif
if var.mouse = true then

if delta(smooth(mouse.DirectInputX))<-3 then
key.A=1
else key.A=0

if delta(smooth(mouse.DirectInputX))>3 then
key.D=1
else key.D=0
endif
I noticed this program has the ability to use macros so I'm guessing it's possible. It's a different programming language than the other program so I don't know how to accomplish it yet but I wanted to see if it was possible
Jul 22, 2018  • #1
Keith Lammers (BFS)'s profile on WallpaperFusion.com
I've passed this along to one of our devs to have a look at when he has a few free minutes :)
Jul 23, 2018  • #2
User Image
the dude22
9 discussion posts
Sounds good, I will check back in and see what he came up with. Thanks for the help
Jul 23, 2018  • #3
Thomas Malloch (BFS)'s profile on WallpaperFusion.com
Sorry for the late reply!

I put together a Scripted Function that should work for you. Here's how to set it up:

  • Download the file attached to this post
  • On The Settings->Profiles Tab, double click a Profile you would like to exit, or click the "Add" button
  • Click the "Add" button again
  • On The Edit Macro button, give the Macro a name, and in the Add dropdown, select "Custom Macro Script"
  • Copy the contents of the file you downloaded in the first step to the Macro Script Edit window
  • Review the code if you want, and Select Ok on all of the windows you opened to save and apply your changes.

I hope this works for you!
• Attachment: Joystick Emulation with Mouse.txt [1,636 bytes]
Oct 18, 2019  • #4
User Image
the dude22
9 discussion posts
I guess it's been a while but I never got a notification of the reply. Thanks for the script though. I went ahead and gave it a try. It seems to work but wasn't exactly what I was going for. There's really no dead zone in the center so the keys are constantly being pressed either to the left or the right. Is there a way to get the script to work that way? What I was going for and the other programs does is that if you move the mouse to the left or right direction it will hold down the key until the mouse stops moving. It only toggles the keys on movement and not by the mouse being on the left or right side of the screen. I was also noticing it set up for the left and right keys versus the a and D keys. I can see how to change that in the script but I'm not sure of the key codes for the A and D key with voice bot.
Jun 24, 2024  • #5
Thomas Malloch (BFS)'s profile on WallpaperFusion.com
I put together a Scripted Function that should work for you given your feedback. I also put together a second script that emulates an eight position joystick. For both scripts I made it a lot easier to update the key mapping.

  • Download the file attached to this post
  • On The Settings->Profiles Tab, double click a Profile you would like to exit, or click the "Add" button
  • Click the "Add" button again
  • On The Edit Macro button, give the Macro a name, and in the Add dropdown, select "Custom Macro Script"
  • Copy the contents of the file you downloaded in the first step to the Macro Script Edit window
  • Review the code if you want, and Select Ok on all of the windows you opened to save and apply your changes.

I hope this works for you!
• Attachment: LeftRight from Mouse Relative Movement.txt [3,783 bytes]
• Attachment: mouse_joystick.txt [5,672 bytes]
Jul 26, 2024  • #6
User Image
the dude22
9 discussion posts
Awesome, thank you for making the script! I gave it a test run and it's exactly what I was going for. I appreciate it very much. It is a little touchy with how little the mouse has to move to press the keys but I think I can figure that out.

The mouse moved left
if(delta < 0)

I'm pretty sure I'm right but this line of code right here tells it if the mouse position is less than zero press the left key and likewise for the right key? So if I were to change the value to something like -5 and 5 for the right it should give a little more play in how far the mouse can move before the key is held. I also seen the threshold command is set to five so maybe that's what I'm supposed to be tweaking. I will keep messing with it and try not to break the script. :-) I know how to write a bit of code with glove pie but but that's the extent of my knowledge. Thank you again for taking the time to do this!
Jul 26, 2024  • #7
Thomas Malloch (BFS)'s profile on WallpaperFusion.com
If you want to tweak the script and how responsive it is or not, I'd recommend changing the two constant values at the start of the script. "Threshold" on line 10, and "IntervalMS" on line 14. If you find the script a bit touchy, then I'd recommend raising the "Threshold" variable. If you find the mouse if being moved for too long, I'd recommend lowering the "IntervalMS" variable.

I hope this helps!
Jul 29, 2024 (modified Jul 29, 2024)  • #8
User Image
the dude22
9 discussion posts
Thanks for getting back to me, I will try to tweak it that way instead.thank you much! This will be a big help to me
Jul 29, 2024  • #9
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(-)  Login to Vote(-)