gombokey

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Original source code: https://github.com/gvalkov/golang-evdev/blob/master/bin/evtest.go

Index

Constants

View Source
const (
	DEFAULT_DEVICE_PATH     = "/dev/input/event*"
	DEFAULT_EXEC_TIMEOUT    = 60
	DEFAULT_INPUT_TIMEOUT   = 5
	DEFAULT_LOG_LEVEL       = "INFO"
	DEFAULT_LOG_TIME_FORMAT = "02.01.2006 15:04:05"
	DEFAULT_PARALLEL        = 1

	LOG_CONFIG_ERROR         = "config error"
	LOG_DEVICE_NOT_SET       = "input device not set. exit."
	LOG_DEVICE_OPEN_ERROR    = "cannot open input device"
	LOG_INPUT_TIMEOUT        = "input timeout"
	LOG_MONITOR_EVENTS       = "monitor events"
	LOG_NO_DEVICES           = "Cannot find any input devices. Exit!"
	LOG_NO_VALID_RULES       = "no valid rules. exit."
	LOG_RULE_DEBUG           = "rule debug"
	LOG_RULE_ERROR           = "rule error"
	LOG_RULE_EXEC            = "rule exec"
	LOG_RULE_EXEC_NOT_SET    = "exec not set. skip."
	LOG_RULE_FAILED          = "rule failed"
	LOG_RULE_HOLD_NOT_SET    = "hold not set. skip."
	LOG_RULE_LIMIT           = "rule limit"
	LOG_RULE_MATCHED         = "rule matched"
	LOG_RULE_PRESS_NOT_SET   = "press not set. skip."
	LOG_RULE_SIGNATURE_ERROR = "signature error"
	LOG_RULE_SUCCESS         = "rule success"
	LOG_RULE_TIMEOUT         = "rule timeout"
	LOG_VALID_RULES_FOUND    = "valid rules"

	CONFIG_SAMPLE = `` /* 912-byte string literal not displayed */

)

Variables

View Source
var (
	APP_NAME    = "gombokey"
	APP_VERSION = "devel"
)

Functions

func AppendPrefix

func AppendPrefix(s []string) []string

append "KEY_" prefix to keys names (A -> KEY_A).

func DeleteValueFromSlice

func DeleteValueFromSlice(s []string, v string) []string

func MapKeysToStringSlice

func MapKeysToStringSlice(m *map[string]int64) []string

func RunApp

func RunApp()

func SortLogFields

func SortLogFields(s []string)

func ToSort

func ToSort(s []string) []string

sort hold keys (order independent, Ctrl+Alt || Alt+Ctrl).

func ToUpper

func ToUpper(s []string) []string

bring rule keys to uppercase (CtRl -> CTRL).

func ToUpperAndSort

func ToUpperAndSort(s []string) []string

Types

type Config

type Config struct {
	ExecTimeout  int
	Hold         []string
	InputDevice  string
	InputTimeout int
	LogLevel     string
	Parallel     int
	Rules        map[string]*Rule
}

type Rule

type Rule struct {
	Name            string
	Exec            []string
	ExecTimeout     int
	Hold            []string
	Parallel        int
	ParallelCounter int
	Press           []string
	// contains filtered or unexported fields
}

func (*Rule) AddTask

func (r *Rule) AddTask() bool

func (*Rule) DelTask

func (r *Rule) DelTask() bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL