sendkeys icon indicating copy to clipboard operation
sendkeys copied to clipboard

[bug]: Key combination sent with sendkeys usually have no effect on target application unless a dummy key is also sent

Open mahush opened this issue 3 years ago • 0 comments

What went wrong?

When I sent the key combination command+shift+m to Microsoft Teams with the following command:

sendkeys --application-name "Microsoft Teams" --characters "<k:m:shift,command>"

Usually there is no effect (mute state in Microsoft Teams should have changed). Sometimes it works but I was not able to recognize a pattern. The interesting thing is there seems to be a workaround: adding additional keys, e.g.:

sendkeys --application-name "Microsoft Teams" --characters "<k:m:shift,command> " (no-op space at the end) or sendkeys --application-name "Microsoft Teams" --characters "<c:shift><k:m:shift,command>" (no-op shift at the beginning)

Expected result:

I expect that there is no need for no-ops.

Actual result:

Without no-ops there was no reliable delivery of the described keystrokes.

Other information:

  • Sendkeys version: v2.8.0
  • Operating system: MacOS
  • Processor (e.g. Intel, M1): M1
  • There was a bug report in the past (https://github.com/socsieng/sendkeys/issues/56) where you @socsieng proposed to add a no-op to solve a very similar issue. I consider the need for such a no-op as bug. Maybe you agree ;-)

mahush avatar Aug 08 '22 19:08 mahush