-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is a cleaner implementation of #5, will be removed if it starts interfering with anticheat software
- Loading branch information
1 parent
2e15d0c
commit 3d871da
Showing
5 changed files
with
65 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
//go:build windows | ||
// +build windows | ||
|
||
package hotkeyd | ||
|
||
import ( | ||
"github.com/micmonay/keybd_event" | ||
"time" | ||
) | ||
|
||
func CloseWindow() { | ||
kb, err := keybd_event.NewKeyBonding() | ||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
// Select keys to be pressed | ||
kb.SetKeys(keybd_event.VK_F4) | ||
|
||
// Set ALT to be pressed | ||
kb.HasALT(true) | ||
|
||
time.Sleep(10 * time.Millisecond) | ||
kb.Press() | ||
time.Sleep(10 * time.Millisecond) | ||
kb.Release() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters