Skip to content
This repository was archived by the owner on Nov 20, 2025. It is now read-only.
This repository was archived by the owner on Nov 20, 2025. It is now read-only.

Question/Bug - Setting the same key twice only outputs once #30

@odgers-chrisf

Description

@odgers-chrisf

Issue / Question

Description

When trying to output a word like 'Hello' using the SetKeys method, only one 'l' is outputted when using kb.Launching()

Is this intended?

Replicating

  • OS = W10 Pro
  • Go = go version go1.15.7 windows/amd64

Code:

package main

import (
	"time"

	"github.com/micmonay/keybd_event"
)

func main() {
	kb, err := keybd_event.NewKeyBonding()
	if err != nil {
		panic(err)
	}
	time.Sleep(2 * time.Second)
	
	// Select keys to be pressed
	kb.SetKeys(keybd_event.VK_H, keybd_event.VK_E, keybd_event.VK_L, keybd_event.VK_L, keybd_event.VK_O, keybd_event.VK_L) // extra L at the end for test 

	// Press the selected keys
	err = kb.Launching() 
	if err != nil {
		panic(err)
	}
}

Output

image

Sorry if this isn't a bug - If I am using this incorrectly, please could you give an example of how to use this correctly?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions