Capture ctrl+click from button not in focus?
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
- dan.potter
- Posts: 709
- Last visit: Wed Nov 14, 2018 11:39 am
Re: Capture ctrl+click from button not in focus?
Events are always handled. How could you create a click on a control not in focus. That is not possible. Keyboard and mouse events are always handled by the control in focus.
- dan.potter
- Posts: 709
- Last visit: Wed Nov 14, 2018 11:39 am
Re: Capture ctrl+click from button not in focus?
I was hoping their was a simpler way within the click event.
Code: Select all
$Creds_Click={
if ($ctrl) { Get-Credential | Export-Clixml $env:userprofile\cred.xml
$ctrl = $false
}
}
$cred_keydown=[System.Windows.Forms.KeyEventHandler]{
$script:ctrl = $true
}