Commit 11d392f5 authored by deuce's avatar deuce
Browse files

Allow scrollwheel to go into/out of scrollback mode when connected.

parent 47a5ca24
......@@ -46,6 +46,8 @@ void viewscroll(void)
set_modepalette(palettes[COLOUR_PALETTE]);
gotoxy(1,1);
textattr(uifc.hclr|(uifc.bclr<<4)|BLINK);
ciomouse_addevent(CIOLIB_BUTTON_4_PRESS);
ciomouse_addevent(CIOLIB_BUTTON_5_PRESS);
for(i=0;(!i) && (!quitting);) {
if(top<1)
top=1;
......@@ -70,6 +72,14 @@ void viewscroll(void)
case CIOLIB_BUTTON_1_DRAG_START:
mousedrag(scrollback);
break;
case CIOLIB_BUTTON_4_PRESS:
top--;
break;
case CIOLIB_BUTTON_5_PRESS:
top++;
if (top > cterm->backpos)
i = 1;
break;
}
break;
case CIO_KEY_UP:
......
......@@ -138,6 +138,7 @@ void setup_mouse_events(struct mouse_state *ms)
ciomouse_addevent(CIOLIB_BUTTON_1_DRAG_END);
ciomouse_addevent(CIOLIB_BUTTON_2_CLICK);
ciomouse_addevent(CIOLIB_BUTTON_3_CLICK);
ciomouse_addevent(CIOLIB_BUTTON_4_PRESS);
}
#if defined(__BORLANDC__)
......@@ -2653,12 +2654,19 @@ BOOL doterm(struct bbslist *bbs)
case CIOLIB_BUTTON_2_RELEASE:
case CIOLIB_BUTTON_3_PRESS:
case CIOLIB_BUTTON_3_RELEASE:
case CIOLIB_BUTTON_4_PRESS:
case CIOLIB_BUTTON_5_PRESS:
case CIOLIB_MOUSE_MOVE:
case CIOLIB_BUTTON_1_CLICK:
conn_send(mouse_buf, fill_mevent(mouse_buf, sizeof(mouse_buf), &mevent, &ms), 0);
break;
case CIOLIB_BUTTON_4_PRESS:
case CIOLIB_BUTTON_5_PRESS:
if (ms.mode != 9 && ms.mode != 0) {
conn_send(mouse_buf, fill_mevent(mouse_buf, sizeof(mouse_buf), &mevent, &ms), 0);
break;
}
viewscroll();
setup_mouse_events(&ms);
break;
case CIOLIB_BUTTON_1_DRAG_START:
mousedrag(scrollback_buf);
break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment