Skip to content

superp00t/keystroke

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

keystroke

keystroke aims to be a simple, cross-platform Cgo library for specifying global key combination bindings.

License: MIT

Requirements

  • C Compiler
  • on Mac OS: run process as root, or whitelist app in Privacy settings
  • Linux/FreeBSD/Dragonfly only: x11 development headers

TODO

  • Tested on Windows ✓
  • Tested on Mac OS ✓
  • Test on Linux ❌

Example

package main

import (
  "fmt"
  "os"

  "github.com/superp00t/keystroke"
)

func main() {
  k := keystroke.New()

  k.On("Alt+Shift+Z", func() {
    fmt.Println("Key combination invoked!")
  })

  k.On("N+J+K", func() {
    fmt.Println("Exiting")
    os.Exit(0)
  })

  err := k.Run()
  if err != nil {
    fmt.Println(err)
  }
}

About

Cross-platform Cgo API for customizable key bindings

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published