Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If you press a key such as left or right once, the "fn" key remains pressed thereafter. #614

Open
1 of 3 tasks
yowpark opened this issue Sep 13, 2023 · 0 comments
Open
1 of 3 tasks

Comments

@yowpark
Copy link

yowpark commented Sep 13, 2023

  • Robotgo version (or commit ref): v1.0.0-beta5, v1.0.0-rc2.1
  • Go version: go version go1.18.4 darwin/arm64
  • Gcc version: Apple clang version 14.0.0 (clang-1400.0.29.202)
    Target: arm64-apple-darwin22.1.0
    Thread model: posix
    InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
  • Operating system and bit: macOS / arm64, M2 MacBook Pro
  • Resolution:
  • Can you reproduce the bug at Examples:
    • Yes (provide example code)
    • No
    • Not relevant
  • Provide example code:
package main

import (
	"github.com/go-vgo/robotgo"
)

func run() {
	robotgo.Sleep(5)

	seqs := [][]string{
		{"left"},
		{"f"},
		{"left", "up"},
		{"f", "up"},
	}

	for _, s := range seqs {
		var metaInterfaces []interface{}
		for i := 1; i < len(s); i++ {
			metaInterfaces = append(metaInterfaces, s[i])
		}
		robotgo.KeyToggle(s[0], metaInterfaces...)
		robotgo.MilliSleep(300)

		// with robotgo under v1.0.0-beta5
		// sExceptFirst := s[1:]
		// robotgo.KeyToggle(s[0], sExceptFirst...)
		// robotgo.MilliSleep(300)
	}
}

func main() {
	run()
}
  • Log gist:

Description

In the macOS environment, if you press the left or right key, the fn key has been pressed since then, so even if you simply press the "f" key, the "fn + f" key is pressed and the app changes to full screen.

After executing the above code with go run ., go to a web browser such as Chrome or Safari and click the url inputfield. If normal, the keyboard caret should move to the left and the letter f should be entered. However, the letter f is not entered and apps such as Chrome or Safari change to full screen.

It was possible to reproduce from v1.0.0-beta5 or higher, but could not be reproduced from v1.0.0-beta4 or lower.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant