0

I am trying to use SendKey Events to send a context menu to the part of the screen I am on in an application. The application is citrix based. I am trying to use sendkeys because they are so reliable over pointing a mouse at a particular spot. If this isn't possible that'd be great to know also, in the mean time i'll pursue it still best I can.

So far I have tried using the"{+F10}" idea but that just produces the value 9 on screen, and I have tried many variations of this as well like

"<={F10}>=" to simulate pressing shift up and down
"+={F10}"
"++{F10}"
"+{F10}""s"
"+{F10}s"

but all of these result in plaintext being sent across, values like '9','=' or '0' are all I see in these cases. if anyone has any insight that would be appreciated.

Dexter Whelan
  • 414
  • 3
  • 15

1 Answers1

1

SendKeys.SendWait("+{F10}"); should be the correct syntax for pressing shift + F10. In case you want to press [shift + F10 + s] SendKeys.SendWait("+({F10}s)"); is your friend.

As stated here the Windows Input Simulator is more reliable for Citrix based Systems compared to SendKeys. You should give it a try.


Add-On to SendKeys: According to the docu SendKeys has a old and a new version available. Please try both as it might help. SendKeys uses the old version by default, but in case it failes the fallback is the new version. To enforce the new version add the following to your app.config:

<appSettings>
<add key="SendKeys" value="SendInput"/>
</appSettings>

You could also try to enforce the old implementation by using: "JournalHook" as value.

There is a further remark in the docu which says:

If your application is intended for international use with a variety of keyboards, the use of Send could yield unpredictable results and should be avoided.

Not sure whether this applies for you.

Further alternatives you could go for are AutoIt or UIAutomation, may requiering a bit more time digging into it.

Haphil
  • 1,180
  • 1
  • 14
  • 33
  • The last part there I have managed to rule out about using international keyboards and getting different results. i'm not too familiar with adding in configs to files but ill definitely give that a whack and see how it goes! Going to look up all the stuff you mentioned here! :) – Dexter Whelan Nov 06 '15 at 07:08