-
Notifications
You must be signed in to change notification settings - Fork 911
/
Copy pathkeypress.h
46 lines (41 loc) · 997 Bytes
/
keypress.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
43
44
45
46
#pragma once
#ifndef KEYPRESS_H
#define KEYPRESS_H
#include <stdlib.h>
#include "../base/os.h"
#include "../base/types.h"
#include "keycode.h"
#include <stdbool.h>
#if defined(IS_MACOSX)
typedef enum {
MOD_NONE = 0,
MOD_META = kCGEventFlagMaskCommand,
MOD_ALT = kCGEventFlagMaskAlternate,
MOD_CONTROL = kCGEventFlagMaskControl,
MOD_SHIFT = kCGEventFlagMaskShift
} MMKeyFlags;
#elif defined(USE_X11)
enum _MMKeyFlags {
MOD_NONE = 0,
MOD_META = Mod4Mask,
MOD_ALT = Mod1Mask,
MOD_CONTROL = ControlMask,
MOD_SHIFT = ShiftMask
};
typedef unsigned int MMKeyFlags;
#elif defined(IS_WINDOWS)
enum _MMKeyFlags {
MOD_NONE = 0,
/* These are already defined by the Win32 API */
/* MOD_ALT = 0,
MOD_CONTROL = 0,
MOD_SHIFT = 0, */
MOD_META = MOD_WIN
};
typedef unsigned int MMKeyFlags;
#endif
#if defined(IS_WINDOWS)
/* Send win32 key event for given key. */
void win32KeyEvent(int key, MMKeyFlags flags, uintptr pid, int8_t isPid);
#endif
#endif /* KEYPRESS_H */