mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-05-31 06:13:55 +00:00
Add: add cmd to the ctrl supported
This commit is contained in:
parent
f4f4a3d319
commit
e8b3975205
@ -1,14 +1,14 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"io/ioutil"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/go-vgo/robotgo/clipboard"
|
"github.com/go-vgo/robotgo/clipboard"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
out, err := ioutil.ReadAll(os.Stdin)
|
out, err := io.ReadAll(os.Stdin)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
9
key.go
9
key.go
@ -322,6 +322,15 @@ var keyNames = map[string]C.MMKeyCode{
|
|||||||
// { NULL: C.K_NOT_A_KEY }
|
// { NULL: C.K_NOT_A_KEY }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CmdCtrl If the operating system is macOS, return the key string "cmd",
|
||||||
|
// otherwise return the key string "ctrl
|
||||||
|
func CmdCtrl() string {
|
||||||
|
if runtime.GOOS == "darwin" {
|
||||||
|
return "cmd"
|
||||||
|
}
|
||||||
|
return "ctrl"
|
||||||
|
}
|
||||||
|
|
||||||
// It sends a key press and release to the active application
|
// It sends a key press and release to the active application
|
||||||
func tapKeyCode(code C.MMKeyCode, flags C.MMKeyFlags, pid C.uintptr) {
|
func tapKeyCode(code C.MMKeyCode, flags C.MMKeyFlags, pid C.uintptr) {
|
||||||
C.toggleKeyCode(code, true, flags, pid)
|
C.toggleKeyCode(code, true, flags, pid)
|
||||||
|
Loading…
Reference in New Issue
Block a user