Author Topic: Mouse mapping  (Read 2147 times)

AncientGael

  • Newbie
  • *
  • Posts: 6
Mouse mapping
« on: October 06, 2020, 04:13:09 PM »
This seems more difficult than it should be. I want to map the two side buttons on my mouse (front and back) to keyboard presses, instead of using a voice command. Voice attack doesn't want to comply. I map my command to the back mouse button, through "when i press mouse" it opens the mouse shortcut box, but i have to manually select the button as pressing it on the mouse doesn't seem to get it. Finish and exit out........... And no, Machine says no. The other oddity is in the main VA box when i press my front back Mouse buttons they appear as New command' and "new command 2'... So VA sees the mouse buttons

What am i doing wrong?

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Mouse mapping
« Reply #1 on: October 06, 2020, 04:18:33 PM »
The buttons on the "Mouse Shortcut" dialog are designed to be clicked, they do not automatically detect presses like the "Command Shortcut" dialog for keyboard keys.

If you have mapped commands to execute when you press a mouse button or keyboard key, you will see a notification when they execute in the log on the main window, with the command name you have chosen.
Should this behavior not be desired, you can insert an "Ignore an Unrecognized Word or Phrase" action anywhere in your command, which will stop the log entry from being created.


Note that keyboard and mouse shortcuts are disabled while the "Edit a Profile" window is open.

AncientGael

  • Newbie
  • *
  • Posts: 6
Re: Mouse mapping
« Reply #2 on: October 06, 2020, 05:17:58 PM »
Many thanks I'll give it a try, though it may be that i broke the buttons banging the mouse off my head :P

AncientGael

  • Newbie
  • *
  • Posts: 6
Re: Mouse mapping
« Reply #3 on: October 06, 2020, 05:56:04 PM »
Think i may have found out what the user error is. How do i set the mouse button ti be recognised as pressed until i release it

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Mouse mapping
« Reply #4 on: October 06, 2020, 06:02:20 PM »
What is the actual issue? What are you expecting to happen, and what appears to be happening?

If your intent is to have a keyboard key held down as long as you hold down the mouse button, you have two main options:

Use two commands per button, E.G.
Press forward
with the "When I press mouse" option set to "Forward", and the "Shortcut is invoked only when all buttons are released" option unchecked (the "Do not allow button event to be passed through" option should be checked)
containing:
Code: [Select]
Press down A key

Release forward
with the "When I press mouse" option set to "Forward", and the "Shortcut is invoked only when all buttons are released" option checked (the "Do not allow button event to be passed through" option should be checked)
containing:
Code: [Select]
Release A key

Or, you can use a single command containing a loop that waits for the button to be released, E.G.
Replace forward
with the "When I press mouse" option set to "Forward", and the "Shortcut is invoked only when all buttons are released" option unchecked (the "Do not allow button event to be passed through" option should be checked)
containing:
Code: [Select]
Press down A key
Start Loop While :  Forward Mouse Button Is Pressed
End Loop
Release A key
« Last Edit: October 09, 2020, 11:06:29 AM by Pfeil »

AncientGael

  • Newbie
  • *
  • Posts: 6
Re: Mouse mapping
« Reply #5 on: October 06, 2020, 06:54:30 PM »
First option doesn't work. where or how do you enter that text code into the DOS box to get it to work? Going to leave this for a bit, as ive spent hours trying to get this working instead of gaming

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Mouse mapping
« Reply #6 on: October 06, 2020, 06:58:42 PM »
The "Code" markup only shows what the action list of your command could look like. You need to manually recreate it.


I can assure you the first option works when configured correctly, however,
virtual keypresses do not generate repeated characters (this is not VoiceAttack-specific); You cannot test these commands in notepad, for example.
« Last Edit: October 09, 2020, 11:05:25 AM by Pfeil »

AncientGael

  • Newbie
  • *
  • Posts: 6
Re: Mouse mapping
« Reply #7 on: October 08, 2020, 05:22:07 AM »
Ah ok, i see what you're saying, thanks for all the help will give it another bash when i'm home later

AncientGael

  • Newbie
  • *
  • Posts: 6
Re: Mouse mapping
« Reply #8 on: October 09, 2020, 07:04:48 AM »
Maybe if i explained better what the outcome i would like to be.

Basically i want one of the side buttons on my mouse to function as the ctrl button on the keyboard, in exactly the same way the ctrl button works (it is active while depressed). So if i hold my mouse button and press G on the keyboard, the actual command sent to the software i'm using is CTRL+G.

Thanks for the help!

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Mouse mapping
« Reply #9 on: October 09, 2020, 11:03:02 AM »
That is what either of the example command structures will do, provided you set it up to press the Ctrl key instead of the A key, however in the current version of VoiceAttack (and this may be a Windows API limitation that cannot be circumvented), checking the "Do not allow button event to be passed through" option will prevent the reading of the mouse button state, meaning either the loop in the second example, or the "Shortcut is invoked only when all buttons are released" option in the first, cannot work correctly while that option is enabled.