{"id":24109507,"url":"https://github.com/sashko/go-uinput","last_synced_at":"2025-05-12T23:20:25.257Z","repository":{"id":139217670,"uuid":"129741000","full_name":"sashko/go-uinput","owner":"sashko","description":"Go interface to Linux uinput kernel module that makes it possible to emulate input devices from userspace","archived":false,"fork":false,"pushed_at":"2020-07-18T18:55:03.000Z","size":27,"stargazers_count":6,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-01T04:32:50.660Z","etag":null,"topics":["go","golang","uinput"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sashko.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-16T12:36:27.000Z","updated_at":"2024-01-07T23:52:48.000Z","dependencies_parsed_at":"2024-06-19T19:05:15.388Z","dependency_job_id":"beacc437-a256-4213-a6e4-ad84d6aaadc3","html_url":"https://github.com/sashko/go-uinput","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sashko%2Fgo-uinput","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sashko%2Fgo-uinput/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sashko%2Fgo-uinput/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sashko%2Fgo-uinput/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sashko","download_url":"https://codeload.github.com/sashko/go-uinput/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253837870,"owners_count":21972052,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","uinput"],"created_at":"2025-01-11T00:49:30.426Z","updated_at":"2025-05-12T23:20:25.182Z","avatar_url":"https://github.com/sashko.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-uinput\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n[![Build Status](https://travis-ci.org/sashko/go-uinput.svg?branch=master)](https://travis-ci.org/sashko/go-uinput)\n[![Coverage Status](https://coveralls.io/repos/github/sashko/go-uinput/badge.svg?branch=master)](https://coveralls.io/github/sashko/go-uinput?branch=master)\n[![Go Report Card](https://goreportcard.com/badge/github.com/sashko/go-uinput)](https://goreportcard.com/report/github.com/sashko/go-uinput)\n\ngo-uinput is Go interface to Linux uinput kernel module that makes it possible to emulate input devices from userspace.\n\nThe interface aims to make it dead simple to create virtual input devices, e.g. keyboard, joystick, or mice for generating arbitrary input events programmatically.\n\n## System prerequisites\n\nFirst, the system must have `uinput` kernel module loaded.\n\n    sudo modprobe -i uinput\n\nSecond, `/dev/uinput` device is owned by root and therefore its default permissions must either be changed using chmod\n\n    sudo chmod 666 /dev/uinput\n\nor, which is a much more preferred option, add the udev rule to allow a user use the device\n\n    echo KERNEL==\"uinput\", MODE=\"0666\" | sudo tee /etc/udev/rules.d/90-$USER.rules\n    sudo udevadm trigger\n\n## Installation\n\nTo build the package from sources, clone the repository and run\n\n    go build\n    go install\n\nAlternatively, use `go get` to obtain and install the package in your `$GOPATH`\n\n    go get github.com/sashko/go-uinput\n\n## Usage\n\nThe following example shows how to create a new virtual keyboard, and how to send a key press event.\n\nAll the default imports and error handlers were removed for the sake of simplicity.\n\n```go\nfunc main() {\n\tkeyboard, err := uinput.CreateKeyboard()\n\n\tdefer keyboard.Close()\n\n\t// Press left Shift key, press G, release Shift\n\tkeyboard.KeyDown(uinput.KeyLeftShift)\n\tkeyboard.KeyPress(uinput.KeyG)\n\tkeyboard.KeyUp(uinput.KeyLeftShift)\n\n\t// Press O key\n\tkeyboard.KeyPress(uinput.KeyO)\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsashko%2Fgo-uinput","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsashko%2Fgo-uinput","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsashko%2Fgo-uinput/lists"}