Skip to content

Commit

Permalink
Merge pull request #10 from mkht/FixOpenBrackets
Browse files Browse the repository at this point in the history
FIX: open bracket keys not being sent to remote.
  • Loading branch information
DarkCoderSc authored Jan 15, 2022
2 parents 4f0e328 + 233f2cd commit bae288a
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions PowerRemoteDesktop_Viewer/PowerRemoteDesktop_Viewer.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -1484,24 +1484,25 @@ function Invoke-RemoteDesktopViewer
{
if ($_.KeyChar)
{
$String = [string]$_.KeyChar

$String = $String.Replace("{", "{{}")
$String = $String.Replace("}", "{}}")

$String = $String.Replace("+", "{+}")
$String = $String.Replace("^", "{^}")
$String = $String.Replace("%", "{%}")
$String = $String.Replace("~", "{%}")
$String = $String.Replace("(", "{()}")
$String = $String.Replace(")", "{)}")
$String = $String.Replace("[", "{[]}")
$String = $String.Replace("]", "{]}")

Send-VirtualKeyboard -KeyChain $String
}
switch -CaseSensitive ([string]$_.KeyChar)
{
"{" { $result = "{{}" }
"}" { $result = "{}}" }
"+" { $result = "{+}" }
"^" { $result = "{^}" }
"%" { $result = "{%}" }
"~" { $result = "{~}" }
"(" { $result = "{(}" }
")" { $result = "{)}" }
"[" { $result = "{[}" }
"]" { $result = "{]}" }
Default { $result = $_ }
}

Send-VirtualKeyboard -KeyChain $result
}
}
)
)

$virtualDesktopForm.Form.Add_KeyDown(
{
Expand Down

0 comments on commit bae288a

Please sign in to comment.