Author Topic: Enter text as one lump :/  (Read 2782 times)

paul2978

  • Guest
Enter text as one lump :/
« on: March 10, 2018, 06:21:04 AM »
Hi

So I'm using voice attack to mainly control my pc rather than for gaming.

Id like to use it to paste some text as a group and not has individual letters. I generally do a lot of php work so I would like to enter the following text saying the word "PHP".

Quote
<?php  ?>

I can do this using the "quick input command"

My problem is, if I make a mistake,  to undo it, (my undo command "contrl+Z" )it removes a single letter at a time as if I have typed it.

Is there a way to have it set as a paste option the the whole <php? ?>  in some kind of variable? similar to a copy and paste action.

Also an extra addition would be if the cursor position could be with the php tags? <php? [cursor here]?>

I did have this setup by using "quick input command" with the left arrow key pressed a few times.

Any support and I would be most grateful.

Paul


paul2978

  • Guest
Re: Enter text as one lump :/
« Reply #1 on: March 10, 2018, 06:50:25 AM »
I did it using...."set windows clipboard"


But cant get the cursor where I want in between the tags....any suggestions for that one?

Thanks


Paul

paul2978

  • Guest
Re: Enter text as one lump :/
« Reply #2 on: March 10, 2018, 07:02:20 AM »
Set Windows clipboard to '<?php   ?>'
Press Left Ctrl+V keys and hold for 1 second and release
Start Loop : Repeat 4 Times
    Press Left key and hold for 0.1 seconds and release
End Loop
Clear the Windows clipboard


my current option....

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2827
Re: Enter text as one lump :/
« Reply #3 on: March 10, 2018, 09:24:46 AM »
What you have posted would be the best solution (although a 1 second pause is probably not necessary).  There is no way to just tell VA to move the cursor somewhere other than using the normal input methods that you have used (in this case, move left four characters by pressing the arrow key).  The loops can use variables or tokens to indicate the number of characters, so, there are some ways to get crafty with subcommands.

VA does not provide a, 'paste' action, as paste for some could be ctrl+v, others it is shift+insert.  Also, the paste could require any number of delays depending on context, plus, the target of the paste usually has it's own set of rules, so, I opted to just let the user make their own paste instead of making an action that requires a bunch of options ;)

Rhaedas

  • Jr. Member
  • **
  • Posts: 72
Re: Enter text as one lump :/
« Reply #4 on: March 11, 2018, 02:10:18 PM »
I thought of an imperfect way of undoing a command like you have set up. Imperfect because just like in gaming, VA doesn't have a way of knowing what's really going on, only what you tell it to do. But how about this...when you call a command to input a text string, it also sets a variable called UndoLastCmd with the length of that string (your example would be '10'). If you call a command "Undo last", that would do the following: Press End to move the cursor to the end of the line, then loop a Del for the Undo variable amount. The limitation is that you'd have to call it before you move anywhere or put in more text. Maybe you can take the idea and modify it to what you really need.