keys

package
v0.0.0-...-547ecca Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2016 License: MIT Imports: 19 Imported by: 1

Documentation

Index

Constants

View Source
const (
	RELEASE      = byte('@')
	SPACE        = byte(' ')
	COMMENT      = byte('#')
	LINECONTINUE = byte('\\')
	SEMICOLON    = byte(';')
	COMMA        = byte(',')
	DASH         = byte('-')
)

Variables

View Source
var ButtonParseError = Krror("Could not find a valid mouse button in the string '%s'. Button binding failed.").Out
View Source
var KeyParseError = Krror("Could not find a valid keycode in the string '%s'. Key binding failed.").Out
View Source
var MalformedOrder = Krror("malformed order:\n%+v\n, must contain both keys & action").Out
View Source
var NoKey = Krror("there is no corresponding key for %+v").Out
View Source
var NotaSequence = Krror("is not a %s sequence: %s").Out
View Source
var ParseError = Krror("error parsing configuration: %s").Out
View Source
var UnMappable = Krror("could not get %s mapping: %v, unrecoverable.").Out

Functions

func ByteToString

func ByteToString(k *Keyboard, b1 byte, b2 byte) string

func DefaultHandle

func DefaultHandle(k *Keys) error

func DefaultLoader

func DefaultLoader(k *Keys) error

func DefaultLogger

func DefaultLogger(k *Keys) error

func DefaultSettings

func DefaultSettings(k *Keys) error

func GrabKeyChecked

func GrabKeyChecked(c *xgb.Conn, win xproto.Window, mods uint16, key xproto.Keycode) error

func Krror

func Krror(err string) *keysError

func MouseGrabChecked

func MouseGrabChecked(c *xgb.Conn, win xproto.Window, mods uint16, button xproto.Button) error

func MouseUngrabChecked

func MouseUngrabChecked(c *xgb.Conn, win xproto.Window, mods uint16, button xproto.Button)

func ParseKeyInput

func ParseKeyInput(k *Keyboard, s string) (uint16, []xproto.Keycode, error)

func ParseMouseInput

func ParseMouseInput(s string) (uint16, xproto.Button, error)

func UngrabKeyChecked

func UngrabKeyChecked(c *xgb.Conn, win xproto.Window, mods uint16, key xproto.Keycode)

Types

type Activitable

type Activitable interface {
	Clear()
	Active() (int64, bool)
	Activated() bool
	Expiry(time.Duration)
}

type Call

type Call struct {
	// contains filtered or unexported fields
}

type Chain

type Chainable

type Chainable interface {
	Head() Chain
	Tail() Chain
	SetPrev(Chain)
	Prev() Chain
	SetNext(Chain)
	Next() Chain
	Append(Chain)
}

type Cmd

type Cmd struct {
	// contains filtered or unexported fields
}

func (*Cmd) Bytes

func (c *Cmd) Bytes() []byte

func (*Cmd) Exec

func (c *Cmd) Exec(param string) *exec.Cmd

func (*Cmd) String

func (c *Cmd) String() string

type Commandable

type Commandable interface {
	AddCommand(*Cmd)
	Command() *Cmd
}

type Config

type Config interface {
	Order() int
	Configure(*Keys) error
}

func DefaultConfig

func DefaultConfig(fn ConfigFn) Config

func Logger

func Logger(l *log.Logger) Config

func NewConfig

func NewConfig(order int, fn ConfigFn) Config

func SetSettings

func SetSettings(env, path, file string, expiry time.Duration, verbose bool) Config

type ConfigFn

type ConfigFn func(*Keys) error

type Configuration

type Configuration interface {
	Add(...Config)
	AddFn(...ConfigFn)
	Configure(*Keys) error
	Configured() bool
}

type Detailable

type Detailable interface {
	Mechanic() x.Xevent
	Raw() string
	String() string
	Chained() string
}

type Handle

type Handle interface {
	x.Handle
	KeyStore
}

func NewHandle

func NewHandle(display string) (Handle, error)

type KeyStore

type KeyStore interface {
	Keyboard() *Keyboard
	Caller() x.Call
	Put(Call, Keyable)
	Get(x.Event) ([]Keyable, string, error)
}

func NewKeyStore

func NewKeyStore(kb *Keyboard) KeyStore

type Keyable

type Keyable interface {
	Attach(Handle, xproto.Window) error
	Run(string) error
}

type Keyboard

type Keyboard struct {
	Min xproto.Keycode
	Max xproto.Keycode
	*xproto.GetKeyboardMappingReply
}

func NewKeyboard

func NewKeyboard(c *xgb.Conn, s *xproto.SetupInfo) (*Keyboard, error)

func (*Keyboard) KeycodeToString

func (k *Keyboard) KeycodeToString(keycode xproto.Keycode) string

func (*Keyboard) Keycodes

func (k *Keyboard) Keycodes(keysym xproto.Keysym) []xproto.Keycode

func (*Keyboard) Keysymget

func (k *Keyboard) Keysymget(keycode xproto.Keycode, column byte) xproto.Keysym

func (*Keyboard) StrToKeycode

func (k *Keyboard) StrToKeycode(str string) []xproto.Keycode

type Keys

type Keys struct {
	Configuration
	*log.Logger
	*Settings
	Loader

	Handle
	// contains filtered or unexported fields
}

func New

func New(cnf ...Config) *Keys

func (*Keys) ConfigureChains

func (k *Keys) ConfigureChains(chains []Chain) error

func (*Keys) SignalHandler

func (k *Keys) SignalHandler(s os.Signal)

type Loader

type Loader interface {
	Load(string) ([]Chain, error)
	Loaded() bool
}

type Settings

type Settings struct {
	Env         string
	Path        string
	File        string
	ChainExpiry time.Duration
	Verbose     bool
}

func NewSettings

func NewSettings(env, path, file string, expiry time.Duration, verbose bool) *Settings

func (*Settings) LoadPath

func (s *Settings) LoadPath() string

Jump to

Keyboard shortcuts

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