-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvtmouse.h
42 lines (35 loc) · 867 Bytes
/
vtmouse.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
#ifdef SPLITVT_SOURCE
#include "vt100.h"
#include "video.h"
#endif
#include <stdio.h>
#define REPORT_SELECTION
/* Definitions for button_state bitmasks */
#define BUTTON_MASK 0x03
#define BUTTON_1 0x00
#define BUTTON_2 0x01
#define BUTTON_3 0x02
#define RELEASE 0x03
#define SHIFT 0x04
#define META 0x08
#define CONTROL 0x0F
#define SELECTED 0xF0
struct event {
int happening;
unsigned char button_state;
unsigned int x;
unsigned int y;
#ifdef REPORT_SELECTION
struct {
int begin_col;
int begin_row;
int end_col;
int end_row;
} selection;
#endif
};
#define BUTTON_ISSET(X, B) ((X.button_state&BUTTON_MASK) == B)
extern int terminal_input; /* Set true if event_getc() can read input */
extern int event_init(FILE *input, FILE *output, char *titlebar);
extern int event_getc(struct event *X_event);
extern void event_quit(void);