mirror of
https://github.com/tmate-io/tmate.git
synced 2025-08-10 22:23:34 +02:00
Merge remote-tracking branch 'tmux/master'
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
/* $OpenBSD$ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||
* Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
@ -383,8 +383,42 @@ server_client_check_mouse(struct client *c)
|
||||
c->tty.mouse_drag_update = NULL;
|
||||
c->tty.mouse_drag_release = NULL;
|
||||
|
||||
/*
|
||||
* End a mouse drag by passing a MouseUp key corresponding to
|
||||
* the button that started the drag.
|
||||
*/
|
||||
switch (c->tty.mouse_drag_flag) {
|
||||
case 1:
|
||||
if (where == PANE)
|
||||
key = KEYC_MOUSEUP1_PANE;
|
||||
if (where == STATUS)
|
||||
key = KEYC_MOUSEUP1_STATUS;
|
||||
if (where == BORDER)
|
||||
key = KEYC_MOUSEUP1_BORDER;
|
||||
break;
|
||||
case 2:
|
||||
if (where == PANE)
|
||||
key = KEYC_MOUSEUP2_PANE;
|
||||
if (where == STATUS)
|
||||
key = KEYC_MOUSEUP2_STATUS;
|
||||
if (where == BORDER)
|
||||
key = KEYC_MOUSEUP2_BORDER;
|
||||
break;
|
||||
case 3:
|
||||
if (where == PANE)
|
||||
key = KEYC_MOUSEUP3_PANE;
|
||||
if (where == STATUS)
|
||||
key = KEYC_MOUSEUP3_STATUS;
|
||||
if (where == BORDER)
|
||||
key = KEYC_MOUSEUP3_BORDER;
|
||||
break;
|
||||
default:
|
||||
key = KEYC_MOUSE;
|
||||
break;
|
||||
}
|
||||
c->tty.mouse_drag_flag = 0;
|
||||
return (KEYC_MOUSE); /* not a key, but still may want to pass */
|
||||
|
||||
return (key);
|
||||
}
|
||||
|
||||
/* Convert to a key binding. */
|
||||
@ -424,7 +458,11 @@ server_client_check_mouse(struct client *c)
|
||||
}
|
||||
}
|
||||
|
||||
c->tty.mouse_drag_flag = 1;
|
||||
/*
|
||||
* Begin a drag by setting the flag to a non-zero value that
|
||||
* corresponds to the mouse button in use.
|
||||
*/
|
||||
c->tty.mouse_drag_flag = MOUSE_BUTTONS(b) + 1;
|
||||
break;
|
||||
case WHEEL:
|
||||
if (MOUSE_BUTTONS(b) == MOUSE_WHEEL_UP) {
|
||||
|
Reference in New Issue
Block a user