|
|
@ -228,6 +228,12 @@ typedef struct {
|
|
|
|
char state; /* focus, redraw, visible */
|
|
|
|
char state; /* focus, redraw, visible */
|
|
|
|
} XWindow;
|
|
|
|
} XWindow;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
|
|
int b;
|
|
|
|
|
|
|
|
uint mask;
|
|
|
|
|
|
|
|
char s[ESC_BUF_SIZ];
|
|
|
|
|
|
|
|
} Mousekey;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
typedef struct {
|
|
|
|
KeySym k;
|
|
|
|
KeySym k;
|
|
|
|
uint mask;
|
|
|
|
uint mask;
|
|
|
@ -771,10 +777,24 @@ mousereport(XEvent *e) {
|
|
|
|
void
|
|
|
|
void
|
|
|
|
bpress(XEvent *e) {
|
|
|
|
bpress(XEvent *e) {
|
|
|
|
struct timeval now;
|
|
|
|
struct timeval now;
|
|
|
|
|
|
|
|
Mousekey *mk;
|
|
|
|
|
|
|
|
|
|
|
|
if(IS_SET(MODE_MOUSE)) {
|
|
|
|
if(IS_SET(MODE_MOUSE)) {
|
|
|
|
mousereport(e);
|
|
|
|
mousereport(e);
|
|
|
|
} else if(e->xbutton.button == Button1) {
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for(mk = mshortcuts; mk < mshortcuts + LEN(mshortcuts); mk++) {
|
|
|
|
|
|
|
|
if(e->xbutton.button == mk->b
|
|
|
|
|
|
|
|
&& match(mk->mask, e->xbutton.state)) {
|
|
|
|
|
|
|
|
ttywrite(mk->s, strlen(mk->s));
|
|
|
|
|
|
|
|
if(IS_SET(MODE_ECHO))
|
|
|
|
|
|
|
|
techo(mk->s, strlen(mk->s));
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(e->xbutton.button == Button1) {
|
|
|
|
gettimeofday(&now, NULL);
|
|
|
|
gettimeofday(&now, NULL);
|
|
|
|
|
|
|
|
|
|
|
|
/* Clear previous selection, logically and visually. */
|
|
|
|
/* Clear previous selection, logically and visually. */
|
|
|
@ -817,10 +837,6 @@ bpress(XEvent *e) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
sel.tclick2 = sel.tclick1;
|
|
|
|
sel.tclick2 = sel.tclick1;
|
|
|
|
sel.tclick1 = now;
|
|
|
|
sel.tclick1 = now;
|
|
|
|
} else if(e->xbutton.button == Button4) {
|
|
|
|
|
|
|
|
ttywrite("\031", 1);
|
|
|
|
|
|
|
|
} else if(e->xbutton.button == Button5) {
|
|
|
|
|
|
|
|
ttywrite("\005", 1);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|