mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
BSD: Decrease indentation level. Treat buttons 4 & 5 as wheel. If you want
to use wheel mouse on the console run moused with -z 4 option.
This commit is contained in:
parent
4b3d88dd6e
commit
90c013cbd0
@ -5,6 +5,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "osdep/system.h"
|
#include "osdep/system.h"
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
#ifdef CONFIG_SYSMOUSE
|
#ifdef CONFIG_SYSMOUSE
|
||||||
#ifdef HAVE_SYS_CONSIO_H
|
#ifdef HAVE_SYS_CONSIO_H
|
||||||
@ -42,6 +43,7 @@ sysmouse_handler(void *data)
|
|||||||
void *itrm = sp->itrm;
|
void *itrm = sp->itrm;
|
||||||
int fd = get_output_handle();
|
int fd = get_output_handle();
|
||||||
int buttons, change;
|
int buttons, change;
|
||||||
|
int extended_button;
|
||||||
mouse_info_t mi;
|
mouse_info_t mi;
|
||||||
struct term_event_mouse mouse;
|
struct term_event_mouse mouse;
|
||||||
struct term_event ev;
|
struct term_event ev;
|
||||||
@ -66,7 +68,10 @@ sysmouse_handler(void *data)
|
|||||||
case 0:
|
case 0:
|
||||||
switch (prev_buttons) {
|
switch (prev_buttons) {
|
||||||
case 0:
|
case 0:
|
||||||
return;
|
extended_button = mi.u.data.buttons & 24;
|
||||||
|
if (!extended_button) return;
|
||||||
|
if (extended_button & 8) mouse.button = B_WHEEL_UP;
|
||||||
|
else mouse.button = B_WHEEL_DOWN;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
case 3:
|
case 3:
|
||||||
|
Loading…
Reference in New Issue
Block a user