Skip to content

Is it possible to press and Hold key for x amount of seconds? #699

Open
@kennethgargan

Description

@kennethgargan
  • Robotgo version (or commit ref): v0.110.5 (v1.0.0-rc4)
  • Go version: go1.21.2
  • Gcc version: 13.2.0
  • Operating system and bit: Windows 10 - 64 bit
  • Resolution: N/A
  • Can you reproduce the bug at Examples:
    • Yes (provide example code)
    • No
    • Not relevant
  • Provide example code:
package main

import (
	"fmt"

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

func main() {
	fmt.Println("Pressing a for 3 seconds")
	robotgo.KeyDown("a")
	robotgo.Sleep(3)
	robotgo.KeyUp("a")
}
  • Log gist:

Description

Hi, Is it possible to have it so I can press a key down for a certain amount of seconds? In the example code, I want to press a for 3 seconds before releasing the key but it doesn't seem to work.
Is there any way to go about doing this in RobotGo?

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions