Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

rpdg/godd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

1 Commit

Repository files navigation

GoDD

This is a golang wrapper of the DD virtual mouse & keyboard driver.

Tested and working on Windows (10 &11).

How to Use

Please refer to DDxoft.

Include the DLL in the .zip file in to your project.

package main
import (
	"github.com/rpdg/godd"
)
// download the free version from https://github.com/ddxoft/master
const DdDll = "./dd43390.dll"
func main(){
 dd, err := godd.GetDD(DdDll)
	if err != nil {
		panic("Device initialization error, " + err.Error())
		return
	}
 defer func() {
		dd.Close()
	}()
 
 // mouse control functions
 dd.MoveTo(0, 0)
 dd.MoveRelative(50, 150)
 dd.SetMouseButtonState(godd.BtnLeftDown)
 time.Sleep(time.Millisecond * 50)
 dd.SetMouseButtonState(godd.BtnLeftUp)
 dd.ScrollWheel(godd.WheelBackward)
 
 // keyboard control functions
 dd.SendKeyEvent(godd.VK_F1, godd.KeyDown)
 time.Sleep(time.Millisecond * 50)
 dd.SendKeyEvent(godd.VK_F1, godd.KeyUp)
 dd.InputString("some text") 
 
 // shortcut functions
 dd.Click() // performs a single left mouse click
 dd.PressKey(godd.VK_SPACE, time.Millisecond * 100) // holds a key for specified duration
 dd.PressHotkey(godd.VK_LWIN, godd.VK_M) // simulates keyboard shortcuts, e.g. WIN + M
}

License

The GoDD package is open-sourced software licensed under the Apache V2 license.

Feedback & Contribute

Notify me of any issues, bugs, or improvements. Thanks πŸ‘

About

a golang wrapper of DD virtual mouse & keyboard driver.

Resources

License

Stars

Watchers

Forks

Packages

Contributors

Languages

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /