Skip to content

TomoBossi/keynput

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

keynput

uinput but tiny and for keyboard inputs only.

Why?

Because a while back I used uinput to make typeworm, and since then I've been wanting to basically make uinput myself.

What?

This is a minimal uinput-like module, but it only works for keyboard devices. You are probably better off using some other more robust implementation, even if deprecated. This was made just for fun.

How?

Be on Linux. Install the module, import and use it in your program, then compile and run. Make sure you be on Linux first.

func main() {
	keyboard, err := keynput.NewKeyboard("virtual_keyboard")
	if err != nil {
		panic(err)
	}
	defer keyboard.Close()
	
	// send keypress events
	err := keyboard.KeyPress(keynput.KEY_E)
	if err != nil {
		panic(err)
	}
}

Sources

I basically just took code from uinput and adapted it to my needs.

About

uinput but tiny and for keyboard inputs only

Resources

License

Stars

Watchers

Forks

Contributors

Languages