-
Notifications
You must be signed in to change notification settings - Fork 0
/
keychords.h
42 lines (33 loc) · 1.05 KB
/
keychords.h
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
#ifndef KEYCHORDS_H_
#define KEYCHORDS_H_
#include "stdbool.h"
#include <string.h>
#define MAX_KEYCHORD_LENGTH 128
#define LEADER_KEY KEY_SPACE
// Keychord action function type
typedef void (*KeyChordAction)(void);
// Keychord category enumeration
typedef enum {
CATEGORY_THEME,
CATEGORY_WINDOW,
CATEGORY_FILE_MANAGER,
CATEGORY_QUIT_SESSION,
// Add more categories as needed
CATEGORY_COUNT // This keeps track of the total number of categories
} KeyChordCategory;
// Extend the KeyChord structure to include a category
typedef struct {
const char* keychord;
KeyChordAction action;
const char* description; // Description of the keychord
KeyChordCategory category; // Category of the keychord
} KeyChord;
extern KeyChord keychords[];
extern const int keychordCount;
extern char currentKeyChord[MAX_KEYCHORD_LENGTH];
extern bool leaderKeyActive;
extern bool keychordExecuted;
/* void ProcessKeyChord(const char* keys); */
void ProcessKeyChord(const char* keys, char firstChar);
void HandleKeyChords();
#endif // KEYCHORDS_H_