aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/keyin.h
blob: ccfa644d236cffef6424bf28a533ff27374e879a (plain) (blame)
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
#ifndef _KEYIN_H__
#define _KEYIN_H__ 1

typedef struct _Keys_Handler Keys_Handler;

struct _Keys_Handler
{
   Ecore_IMF_Context *imf;
   unsigned int last_keyup;
   Eina_List *seq;
   unsigned char composing : 1;
};

void
keyin_handle_key_to_pty(Termpty *ty, const Evas_Event_Key_Down *ev,
                        const int alt, const int shift, const int ctrl);
Eina_Bool
termpty_can_handle_key(const Termpty *ty,
                       const Keys_Handler *khdl,
                       const Evas_Event_Key_Down *ev);
void keyin_compose_seq_reset(Keys_Handler *khdl);
Eina_Bool key_is_modifier(const char *key);
Eina_Bool
keyin_handle_key_binding(Evas_Object *termio, const Evas_Event_Key_Down *ev,
                         Eina_Bool ctrl, Eina_Bool alt, Eina_Bool shift,
                         Eina_Bool win, Eina_Bool meta, Eina_Bool hyper);

void keyin_handle_up(Keys_Handler *khdl, Evas_Event_Key_Up *ev);

typedef Eina_Bool (*Key_Binding_Cb)(Evas_Object *term);

typedef struct _Shortcut_Action Shortcut_Action;

struct _Shortcut_Action
{
   const char *action;
   const char *description;
   Key_Binding_Cb cb;
};

const Shortcut_Action *shortcut_actions_get(void);

int key_bindings_load(Config *config);
int keyin_add_config(const Config_Keys *cfg_key);
int keyin_remove_config(const Config_Keys *cfg_key);
void key_bindings_shutdown(void);

#endif