You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I looked into this and made a fixed on my local system and I was going to make a PR for it but this project is locked down I believed. So here what I did to make this great menu work on Linux and Mac so one can use the up and down arrow vs crashing out of the menu.
In file: PSMenu/Private/Read-VKey.ps1 I added the following:
try {
if ($IsLinux -or $IsMacOS) {
## A bug with Linux and Mac where arrow keys are return in 2 chars. First is esc follow by A,B,C,D
$key1 = $CurrentHost.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
if ($key1.VirtualKeyCode -eq 0x1B) {
## Found that we got an esc chair so we need to grab one more char
$key2 = $CurrentHost.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
## We just care about up and down arrow mapping here for now.
if ($key2.VirtualKeyCode -eq 0x41) {
# VK_UP = 0x26 up-arrow
$key1.VirtualKeyCode = 0x26
}
if ($key2.VirtualKeyCode -eq 0x42) {
# VK_DOWN = 0x28 down-arrow
$key1.VirtualKeyCode = 0x28
}
}
Return $key1
} else {
return $CurrentHost.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
}
}
Hope this helps.
The text was updated successfully, but these errors were encountered:
mark-hubers
changed the title
Up and down arrow keys do not work on Linux or Mac due to C# bug.
Up and down arrow keys do not work on Linux or Mac due to Dotnet.core bug.
May 23, 2022
I looked into this and made a fixed on my local system and I was going to make a PR for it but this project is locked down I believed. So here what I did to make this great menu work on Linux and Mac so one can use the up and down arrow vs crashing out of the menu.
In file: PSMenu/Private/Read-VKey.ps1 I added the following:
to
Hope this helps.
The text was updated successfully, but these errors were encountered: