DEVELOPMENT ENVIRONMENT

~liljamo/tamma

ref: fef670409e116af69b2607b954e949b9b4ba9c89 tamma/types/keymaps.go -rw-r--r-- 994 bytes
fef67040Jonni Liljamo chore: bump version to 0.1.2 14 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
 * Copyright (C) 2024 Jonni Liljamo <jonni@liljamo.com>
 *
 * This file is licensed under GPL-3.0-only, see NOTICE and LICENSE for
 * more information.
 */

package types

import (
	"github.com/charmbracelet/bubbles/key"
)

// HostListKeyMap defines key bindings for the host list.
type HostListKeyMap struct {
	Quit key.Binding
}

// NewHostListKeyMap returns a new HostListKeyMap.
func NewHostListKeyMap() *HostListKeyMap {
	return &HostListKeyMap{
		Quit: key.NewBinding(
			key.WithKeys("q"),
			key.WithHelp("q", "quit"),
		),
	}
}

// ActionListKeyMap defines key bindings for the action list.
type ActionListKeyMap struct {
	Back        key.Binding
	CopyCommand key.Binding
}

// NewActionListKeyMap returns a new ActionListKeyMap.
func NewActionListKeyMap() *ActionListKeyMap {
	return &ActionListKeyMap{
		Back: key.NewBinding(
			key.WithKeys("q"),
			key.WithHelp("q", "back"),
		),
		CopyCommand: key.NewBinding(
			key.WithKeys("c"),
			key.WithHelp("c", "copy cmd"),
		),
	}
}