# SendKey including modifier key (keydown:shift) in output

**URL:** <https://resource.dopus.com/t/sendkey-including-modifier-key-keydown-shift-in-output/50728>\
**Category:** Help & Support\
**Created:** [May 8, 2024, 5:58pm UTC](https://resource.dopus.com/t/sendkey-including-modifier-key-keydown-shift-in-output/50728 "2024-05-08T17:58:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![grosner](https://resource.dopus.com/user_avatar/resource.dopus.com/grosner/32/27679_2.png) [@grosner](https://resource.dopus.com/u/grosner)\
**Post date:** [May 8, 2024, 5:58pm UTC](https://resource.dopus.com/t/sendkey-including-modifier-key-keydown-shift-in-output/50728/1 "2024-05-08T17:58:26Z")

</div>

With this script, Dopus seems to include the shift key when sending keystrokes with @sendkey.  
This is possibly because I am holding down the shift key while the script runs.

```auto
@keydown:shift
@sendkey:alt+space

```

How can I disable or filter out the shift key when using @sendKey, even though shift is held down?

Use Case:

- Invoke PowerToys Run command using alt + space, clicking a button with: shift + click.

Additional Info:  
[IGNOREOREQUAL](https://resource.dopus.com/t/user-command-and-keydown-bug/4354/4)

---

<div class="post-metadata">

**Author:** ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)\
**Post date:** [May 8, 2024, 6:05pm UTC](https://resource.dopus.com/t/sendkey-including-modifier-key-keydown-shift-in-output/50728/2 "2024-05-08T18:05:36Z")

</div>

If the key is physically held down, I don't think there's any way to stop other software seeing that.

I'm surprised PowerToys Run doesn't have a command line, but it looks like you can change its hotkey to something else, if that helps avoid the issue.

---

<div class="post-metadata">

**Author:** ![grosner](https://resource.dopus.com/user_avatar/resource.dopus.com/grosner/32/27679_2.png) [@grosner](https://resource.dopus.com/u/grosner)\
**Post date:** [May 8, 2024, 6:11pm UTC](https://resource.dopus.com/t/sendkey-including-modifier-key-keydown-shift-in-output/50728/3 "2024-05-08T18:11:26Z")

</div>

My use case is specific to PowerToys, but generally speaking, it would be helpful if Dopus had a setting to ignore the modifier key that was used when clicking the button because the same seems to be true with the other modifiers (ctrl, alt, etc.).

Alternatively, some added documentation would also be helpful in explaining this side effect.  
In other words, let us know that keystrokes sent with SendKeys include any modifier keys held down.

Thanks!

---

<div class="post-metadata">

**Author:** ![grosner](https://resource.dopus.com/user_avatar/resource.dopus.com/grosner/32/27679_2.png) [@grosner](https://resource.dopus.com/u/grosner)\
**Post date:** [May 8, 2024, 8:39pm UTC](https://resource.dopus.com/t/sendkey-including-modifier-key-keydown-shift-in-output/50728/4 "2024-05-08T20:39:54Z")

</div>

Apparently, Autohotkey filters out the depressed shift key when sending its characters.  
Here is what I did to enable using the shift + click to invoke PowerToys Run:

Autohotkey script:

> ;ShowPowerLauncher.ahk  
> #Requires AutoHotkey v2.0  
> #SingleInstance Force  
> send "{Alt Down}{Space Down}{Alt Up}{Alt Up}"  
> ExitApp

Dopus Button Script

> @keydown:shift  
> @async:"C:\Program Files\AutoHotkey\v2\AutoHotkey64.exe" "_[AddUserPathPrefixHere]_\Documents\AutoHotKey\Projects\Power Toys\ShowPowerLauncher.ahk"

I do wonder if having the ability in Dopus to also send the {alt down} {alt up} would make any difference.  
Anyway, I'm posting this solution for the next generation of Dopus users!  
Leo, Thanks again for your help and guidence!

---

<div class="post-metadata">

**Author:** ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)\
**Post date:** [May 8, 2024, 9:23pm UTC](https://resource.dopus.com/t/sendkey-including-modifier-key-keydown-shift-in-output/50728/5 "2024-05-08T21:23:17Z")

</div>

> [@grosner](#):
>
> My use case is specific to PowerToys, but generally speaking, it would be helpful if Dopus had a setting to ignore the modifier key that was used when clicking the button because the same seems to be true with the other modifiers (ctrl, alt, etc.).
> 
> Alternatively, some added documentation would also be helpful in explaining this side effect.  
> In other words, let us know that keystrokes sent with SendKeys include any modifier keys held down.

Not sure I understand this. It’s the other program that will be checking which keys are down/pushed, not Opus.
