This repository has been archived by the owner on Oct 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add presets for FH5 and Genshin Impact
- Loading branch information
Showing
7 changed files
with
97 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package devices | ||
|
||
import ( | ||
"log" | ||
|
||
"github.com/go-vgo/robotgo" | ||
) | ||
|
||
func pressKey(key string) { | ||
switch key { | ||
case "": | ||
return | ||
case "lclick": | ||
robotgo.Click("left", false) | ||
case "rclick": | ||
robotgo.Click("right", false) | ||
default: | ||
robotgo.KeyDown(key) | ||
} | ||
log.Printf("Key %s pressed", key) | ||
|
||
} | ||
|
||
func releaseKey(key string) { | ||
|
||
switch key { | ||
case "": | ||
return | ||
case "lclick": | ||
case "rclick": | ||
default: | ||
robotgo.KeyUp(key) | ||
} | ||
log.Printf("Key %s released", key) | ||
} | ||
|
||
func SetKey(device, key int, target string) { | ||
log.Printf("Set key %d of device %d to %s", key, device, target) | ||
keymap[device][key] = target | ||
} | ||
|
||
func UsePreset(preset string) { | ||
log.Printf("Use preset %s", preset) | ||
keymap = keymap_preset[preset] | ||
} |
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