forked from enlightenment/terminology
emulate cursors if needed on mouse wheel. Closes T411
This is done when in alternate buffer and no mouse mode is set.
This commit is contained in:
parent
fa0cdc0e1d
commit
da8c2ce773
|
@ -3391,6 +3391,7 @@ _smart_cb_mouse_wheel(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNU
|
||||||
{
|
{
|
||||||
Evas_Event_Mouse_Wheel *ev = event;
|
Evas_Event_Mouse_Wheel *ev = event;
|
||||||
Termio *sd = evas_object_smart_data_get(data);
|
Termio *sd = evas_object_smart_data_get(data);
|
||||||
|
char buf[64];
|
||||||
|
|
||||||
EINA_SAFETY_ON_NULL_RETURN(sd);
|
EINA_SAFETY_ON_NULL_RETURN(sd);
|
||||||
|
|
||||||
|
@ -3400,15 +3401,26 @@ _smart_cb_mouse_wheel(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNU
|
||||||
|
|
||||||
if (sd->pty->mouse_mode == MOUSE_OFF)
|
if (sd->pty->mouse_mode == MOUSE_OFF)
|
||||||
{
|
{
|
||||||
sd->scroll -= (ev->z * 4);
|
if (sd->pty->altbuf)
|
||||||
if (sd->scroll > sd->pty->backscroll_num)
|
{
|
||||||
sd->scroll = sd->pty->backscroll_num;
|
/* Emulate cursors */
|
||||||
else if (sd->scroll < 0) sd->scroll = 0;
|
buf[0] = 0x1b;
|
||||||
_smart_update_queue(data, sd);
|
buf[1] = 'O';
|
||||||
|
buf[2] = (ev->z < 0) ? 'A' : 'B';
|
||||||
|
buf[3] = 0;
|
||||||
|
termpty_write(sd->pty, buf, strlen(buf));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sd->scroll -= (ev->z * 4);
|
||||||
|
if (sd->scroll > sd->pty->backscroll_num)
|
||||||
|
sd->scroll = sd->pty->backscroll_num;
|
||||||
|
else if (sd->scroll < 0) sd->scroll = 0;
|
||||||
|
_smart_update_queue(data, sd);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
char buf[64];
|
|
||||||
int cx, cy;
|
int cx, cy;
|
||||||
|
|
||||||
_smart_xy_to_cursor(data, ev->canvas.x, ev->canvas.y, &cx, &cy);
|
_smart_xy_to_cursor(data, ev->canvas.x, ev->canvas.y, &cx, &cy);
|
||||||
|
|
Loading…
Reference in New Issue