Skip to content

marekfilip/keypresslog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Keypresslog

Sample usage:

package main
 
import (
    "fmt"
    "strconv"
    
    "github.com/marekfilip/keypresslog"
)
 
func main() {
    var inputSign string
    devs := keypresslog.Find()
    
    for _, val := range devs {
        fmt.Println("Id->", val.GetId(), "Device->", val.GetName())
    }
    
    fmt.Println("Choose device")
    fmt.Scanln(&inputSign)
    intId, _ := strconv.Atoi(inputSign)
    
    in, err := devs[intId].Read()
    
    if err != nil {
        fmt.Println(err)
        return
    }
    
    for i := range in {
        //listen only key stroke event
        if i.Type == keypresslog.EV_KEY {
            if i.Value == 1 {
                fmt.Println("Click", i.ToString())
            }
        }
    }
}

About

Linux keylogger

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages