mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-05-29 21:43: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
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"os"
|
||||
|
||||
"github.com/go-vgo/robotgo/clipboard"
|
||||
)
|
||||
|
||||
func main() {
|
||||
out, err := ioutil.ReadAll(os.Stdin)
|
||||
out, err := io.ReadAll(os.Stdin)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
9
key.go
9
key.go
@ -322,6 +322,15 @@ var keyNames = map[string]C.MMKeyCode{
|
||||
// { 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
|
||||
func tapKeyCode(code C.MMKeyCode, flags C.MMKeyFlags, pid C.uintptr) {
|
||||
C.toggleKeyCode(code, true, flags, pid)
|
||||
|
Loading…
Reference in New Issue
Block a user