Skip to content

Commit

Permalink
Disable QuickEdit so clicking the terminal doesn't freeze the process
Browse files Browse the repository at this point in the history
  • Loading branch information
optix2000 committed Aug 19, 2021
1 parent 8eebafd commit 08ecfca
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,15 @@ func main() {
if err == nil {
procSetConsoleTitle.Call(uintptr(unsafe.Pointer(title)))
}
handle, err := windows.GetStdHandle(windows.STD_INPUT_HANDLE)
if err == nil {
var mode uint32
err = windows.GetConsoleMode(handle, &mode)
if err == nil {
windows.SetConsoleMode(handle, (mode&^windows.ENABLE_QUICK_EDIT_MODE)|windows.ENABLE_EXTENDED_FLAGS) // Disable QuickEdit mode
}
windows.CloseHandle(handle)
}
fmt.Println(totsugeki)
fmt.Printf(" %s\n", Version)

Expand All @@ -175,7 +184,7 @@ func main() {
*unsafePredictStatsGet = true
}

handle := windows.CurrentProcess()
handle = windows.CurrentProcess()
err = windows.SetPriorityClass(handle, windows.BELOW_NORMAL_PRIORITY_CLASS)
if err != nil {
fmt.Println(err)
Expand Down

0 comments on commit 08ecfca

Please sign in to comment.