config

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: May 12, 2024 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {

	// The program to execute
	Program string `mapstructure:"program"`

	// any arguments for the program.
	Args []string `mapstructure:"args"`
}

Describes the command that will execute when a key is pressed

type Config

type Config struct {

	// The screen name.  Not currently used
	Screen string `mapstructure:"screen"`

	// The array of keys.
	Keys []Key `mapstructure:"keys"`
}

The overall structure for the config file.

type Key

type Key struct {

	// the type of key.  Values can be
	//  - Single
	//  - Chord
	//  - Mode
	Type KeyType `mapstructure:"type"`

	// The key to be pressed.  Check xenv to get the correct key names
	Key string `mapstructure:"key"`

	// The modifiers for the key values can be
	// - super
	// - control
	// - shift
	Modifiers []string `mapstructure:"modifiers"`

	// The command that will be updated.
	Command Command `mapstructure:"command"`

	// a message that can be displayed using goxhkd-status
	Message string `mapstructure:"message"`

	// an array of keys that add chording capabilities
	Chords []Key `mapstructure:"chords"`

	// if true the command will be run when the key is released
	OnRelease bool `mapstructure:"onrelease"`

	// Will force an exit from the current mode.
	ExitMode bool `mapstructure:"exitmode"`

	// Translated for quick lookups.  Not used for the configuration.
	TranslatedChords map[keydefinitions.KeyDefinitionKey]Key `mapstructure:"-"`
}

The configuration of a key.

type KeyType added in v0.0.4

type KeyType int

Indicates if the key definition is a chord, mode, or single

const (
	Single KeyType = iota
	Chord
	Mode
)

enum for key type

func (*KeyType) String added in v0.0.4

func (t *KeyType) String() string

implementation of String() for the KeyType enum

func (*KeyType) UnmarshalText added in v0.0.4

func (t *KeyType) UnmarshalText(text []byte) error

UnmarshalJSON custom implementation This is called by viper to convert the key type

Jump to

Keyboard shortcuts

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