Jump to content
Macro Express Forums

Simulate Keystrokes "Whoops!!!"


Recommended Posts

Is this intentional, or is it a bug?

 

When using Text Type to simulate keystrokes, if the keystrokes being simulated happen to be, and I quote: "<CONTROL>a<DELETE>" Then the function of Ctrl+a Delete occurs.

 

In other words: If I copy some direct editor script from a macro that happens to have the above mentioned code, and use a Text Type command to simulate keystrokes to transcribe it into a text editor, everything that came before the <CONTROL>a<DELETE> gets wiped out.

 

Here, try it out!

<TEXT TYPE Action="0" Text="Bunch of text.  Bunch of text.  Bunch of text.  Bunch of text.  Bunch of text.  Bunch of text.  Bunch of text.  Bunch of text.  Bunch of text.  Bunch of text.  Bunch of text.  Bunch of text.  Bunch of text.  Bunch of text.  Bunch of text.  Bunch of text.  <CONTROL>a<DELETE>Ha-ha!  You lose!"/>

 

The only reason why I would ever use Simulate Keystrokes rather than Use Clipboard, is simple: Clipboard Paste is inconsistently functional (for me, anyway). Ctrl+v works (manually, but not consistently when mimicked by MEP)... so I have a lot of Simulate keystrokes in macros where I would much prefer to Use Clipboard.

 

But then this little situation reared up and irritated me. Can anybody tell me if this is an intentional or unintentional feature?

Link to comment
Share on other sites

This is intentional. When typing CTRL, Alt, Shift and the like are usually intended to modify a key. EG CTRL+B will bold the text. So any time a modifier is used it will type it as a combination. This way we can simply write <Shift>a instead of <Shiftu>a<Shiftd>.

Link to comment
Share on other sites

I am not surprised that it works that way. If I wanted to insert the text <CONTROL>a into a document, I would probably choose to use a series of text type commands:

 

Text Type "<"

Text Type "CONTROL>a"

 

I haven't noticed issues with Clipboard commands, other than it I sometimes need to insert a time "shim" afterward, e.g., a 100 or 150 ms delay. I sometimes use Clipboard commands, and at other times, <CONTROL>c, x, or v. The two techniques appear to to yield identical results.

Link to comment
Share on other sites

This is intentional. When typing CTRL, Alt, Shift and the like are usually intended to modify a key. EG CTRL+B will bold the text. So any time a modifier is used it will type it as a combination. This way we can simply write <Shift>a instead of <Shiftu>a<Shiftd>.

Ok... it was a ridiculously stupid question. I know this, I use this function all the time. I wasn't thinking clearly when I posted it.

 

But it does lead me to an actual question: What if I want it to actually type <CONTROL>a without performing a Ctrl+a ? I mean, when I type it out manually, nothing unintended happens. How do I make "Simulate Keystrokes" actually simulate keystrokes? Is it possible to deactivate the "function" of the functions in Text Type? With a dysfunctional Paste function (apparently isolated to my POS machine at work), I kind of need the "SK" to simulate without variation.

 

Maybe I just need to modify the variable with a Replace < with <<DELAY Flags="\x01" Time=".5"/>... Except that I tried that. <DELAY> isn't one of the commands that translates to Text Type. I guess I may just have to build annoying pop-ups to confirm whether or not the paste has worked (if not, repeat, for example) until I can figure out just wth is wrong with my computer.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...