mirror of
https://github.com/rfvgyhn/min-ed-launcher.git
synced 2026-02-04 17:15:42 +00:00
consume available keys before allowing user to cancel restart
prevents any available keys from automatically cancelling a restart
This commit is contained in:
@ -87,6 +87,7 @@ let rec launchProduct proton processArgs restart productName product =
|
||||
let cancelRestart() =
|
||||
let interval = 250
|
||||
let stopwatch = Stopwatch()
|
||||
Console.consumeAvailableKeys()
|
||||
stopwatch.Start()
|
||||
while Console.KeyAvailable = false && stopwatch.ElapsedMilliseconds < timeout do
|
||||
System.Threading.Thread.Sleep interval
|
||||
|
||||
@ -455,6 +455,9 @@ module Console =
|
||||
let password = readMask [] |> Seq.rev |> String.Concat
|
||||
Console.WriteLine ()
|
||||
password
|
||||
let consumeAvailableKeys () =
|
||||
while Console.KeyAvailable do
|
||||
Console.ReadKey() |> ignore
|
||||
|
||||
module Regex =
|
||||
open System.Text.RegularExpressions
|
||||
|
||||
Reference in New Issue
Block a user