Send payload directly to emulate keystroke

Questions and comments specific to a particular plugin should go here.
Post Reply
User avatar
Fiasco
Plugin Developer
Posts: 222
Joined: Fri Jul 24, 2009 5:32 am
Location: St. Louis MO
Contact:

Send payload directly to emulate keystroke

Post by Fiasco » Thu Aug 08, 2019 6:54 pm

With the mouse plugin I can send coordinates from an event directly with eg.plugins.MouseMoveAbsolute(float[eg.event.payload[0]], float(eg.event.payload[1]))

Can I do the same with emulate keystroke?

User avatar
Fiasco
Plugin Developer
Posts: 222
Joined: Fri Jul 24, 2009 5:32 am
Location: St. Louis MO
Contact:

Re: Send payload directly to emulate keystroke

Post by Fiasco » Thu Aug 08, 2019 8:05 pm

took a lot of tries to figure out

eg.plugins.Window.SendKey(eg.event.payload[0])

User avatar
Fiasco
Plugin Developer
Posts: 222
Joined: Fri Jul 24, 2009 5:32 am
Location: St. Louis MO
Contact:

Re: Send payload directly to emulate keystroke

Post by Fiasco » Thu Aug 08, 2019 8:55 pm

One thing I noticed doing this is that special keys have the trailing curly brace stripped off / not detected

so sending {Enter} as the payload the SendKeys plugin complains about a missing trailing bracket

User avatar
kgschlosser
Site Admin
Posts: 4803
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Send payload directly to emulate keystroke

Post by kgschlosser » Fri Aug 09, 2019 8:00 pm

Fiasco wrote:
Thu Aug 08, 2019 8:55 pm
so sending {Enter} as the payload the SendKeys plugin complains about a missing trailing bracket

eg.plugins.Window.SendKey(eg.event.payload[0] + ('}' * (eg.event.payload[0].count('{') - eg.event.payload[0].count('}')))

this should add back on a trailing curly brace if it is missing from the end. and it will add it only if it is missing.
If you like the work I have been doing then feel free to Image

Post Reply