Skip to content
Snippets Groups Projects
Commit 594c28d1 authored by deuce's avatar deuce
Browse files

Do some crappy scroll-wheel stuff.

parent a5577860
No related branches found
No related tags found
No related merge requests found
......@@ -175,6 +175,8 @@ void uifc_mouse_enable(void)
ciomouse_addevent(CIOLIB_BUTTON_1_CLICK);
ciomouse_addevent(CIOLIB_BUTTON_2_CLICK);
ciomouse_addevent(CIOLIB_BUTTON_3_CLICK);
ciomouse_addevent(CIOLIB_BUTTON_4_PRESS);
ciomouse_addevent(CIOLIB_BUTTON_5_PRESS);
showmouse();
}
......@@ -502,6 +504,10 @@ static int uifc_getmouse(struct mouse_event *mevent)
return(CIO_KEY_F(1));
}
}
if (mevent->event == CIOLIB_BUTTON_4_PRESS)
return(CIO_KEY_UP);
if (mevent->event == CIOLIB_BUTTON_5_PRESS)
return(CIO_KEY_DOWN);
return(0);
}
return(-1);
......@@ -2887,6 +2893,16 @@ void showbuf(int mode, int left, int top, int width, int height, char *title, ch
p += ((width-2-pad-pad));
continue;
}
/* Scroll up */
if (mevnt.event == CIOLIB_BUTTON_4_PRESS) {
p = p-((width-2-pad-pad));
continue;
}
/* Scroll down */
if (mevnt.event == CIOLIB_BUTTON_5_PRESS) {
p += ((width-2-pad-pad));
continue;
}
/* Non-click events (drag, move, multiclick, etc) */
if(mevnt.event!=CIOLIB_BUTTON_CLICK(CIOLIB_BUTTON_NUMBER(mevnt.event)))
continue;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment