summaryrefslogtreecommitdiffstats
path: root/include/keyb.h
blob: 0e7ee4032cc7c0b243e33b4ff19e9cd36bbdeb64 (plain)
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#ifndef ROFI_KEYB_H
#define ROFI_KEYB_H

#include "display.h"

/**
 * @defgroup KEYB KeyboardBindings
 *
 * @{
 */

/**
 * List of all possible actions that can be triggered by a keybinding.
 */
typedef enum
{
    /** Paste from primary clipboard */
    PASTE_PRIMARY = 0,
    /** Paste from secondary clipboard */
    PASTE_SECONDARY,
    /** Clear the entry box. */
    CLEAR_LINE,
    /** Move to front of text */
    MOVE_FRONT,
    /** Move to end of text */
    MOVE_END,
    /** Move on word back */
    MOVE_WORD_BACK,
    /** Move on word forward */
    MOVE_WORD_FORWARD,
    /** Move character back */
    MOVE_CHAR_BACK,
    /** Move character forward */
    MOVE_CHAR_FORWARD,
    /** Remove previous word */
    REMOVE_WORD_BACK,
    /** Remove next work */
    REMOVE_WORD_FORWARD,
    /** Remove next character */
    REMOVE_CHAR_FORWARD,
    /** Remove previous character */
    REMOVE_CHAR_BACK,
    /** Remove till EOL */
    REMOVE_TO_EOL,
    /** Remove till SOL */
    REMOVE_TO_SOL,
    /** Accept the current selected entry */
    ACCEPT_ENTRY,
    ACCEPT_ALT,
    ACCEPT_CUSTOM,
    MODE_NEXT,
    MODE_PREVIOUS,
    TOGGLE_CASE_SENSITIVITY,
    DELETE_ENTRY,
    ROW_LEFT,
    ROW_RIGHT,
    ROW_UP,
    ROW_DOWN,
    ROW_TAB,
    PAGE_PREV,
    PAGE_NEXT,
    ROW_FIRST,
    ROW_LAST,
    ROW_SELECT,
    CANCEL,
    CUSTOM_1,
    CUSTOM_2,
    CUSTOM_3,
    CUSTOM_4,
    CUSTOM_5,
    CUSTOM_6,
    CUSTOM_7,
    CUSTOM_8,
    CUSTOM_9,
    CUSTOM_10,
    CUSTOM_11,
    CUSTOM_12,
    CUSTOM_13,
    CUSTOM_14,
    CUSTOM_15,
    CUSTOM_16,
    CUSTOM_17,
    CUSTOM_18,
    CUSTOM_19,
    SCREENSHOT,
    TOGGLE_SORT,
    SELECT_ELEMENT_1,
    SELECT_ELEMENT_2,
    SELECT_ELEMENT_3,
    SELECT_ELEMENT_4,
    SELECT_ELEMENT_5,
    SELECT_ELEMENT_6,
    SELECT_ELEMENT_7,
    SELECT_ELEMENT_8,
    SELECT_ELEMENT_9,
    SELECT_ELEMENT_10,
    NUM_ABE
} KeyBindingAction;

/**
 * Parse the keybindings.
 * This should be called after the setting system is initialized.
 */
gboolean parse_keys_abe ( void );

/**
 * Setup the keybindings
 * This adds all the entries to the settings system.
 */
void setup_abe ( void );

/**
 * Cleanup.
 */
void cleanup_abe ( void );

/**
 * Find if a binding has been triggered.
 * @returns NUM_ABE if no key combo matches, a valid action otherwise.
 */
KeyBindingAction abe_find_action ( widget_modifier_mask modmask, xkb_keysym_t key );

/**
 * Reset state of all on-release bindings
 */
void abe_reset_release ( void );
/**
 * Trigger keybinding on key release.
 */
void abe_trigger_release ( void );

/*@}*/
#endif // ROFI_KEYB_H