71 |
|
|
72 |
|
|
73 |
|
// Global variables |
74 |
< |
static int32 frame_skip; |
74 |
> |
static int32 frame_skip; // Prefs items |
75 |
> |
static int16 mouse_wheel_mode = 1; |
76 |
> |
static int16 mouse_wheel_lines = 3; |
77 |
> |
|
78 |
|
static int display_type = DISPLAY_WINDOW; // See enum above |
79 |
|
static uint8 *the_buffer; // Mac frame buffer |
80 |
|
static bool redraw_thread_active = false; // Flag: Redraw thread installed |
614 |
|
// Init keycode translation |
615 |
|
keycode_init(); |
616 |
|
|
617 |
+ |
// Read prefs |
618 |
+ |
mouse_wheel_mode = PrefsFindInt16("mousewheelmode"); |
619 |
+ |
mouse_wheel_lines = PrefsFindInt16("mousewheellines"); |
620 |
+ |
|
621 |
|
// Find screen and root window |
622 |
|
screen = XDefaultScreen(x_display); |
623 |
|
rootwin = XRootWindow(x_display, screen); |
1144 |
|
unsigned int button = ((XButtonEvent *)&event)->button; |
1145 |
|
if (button < 4) |
1146 |
|
ADBMouseDown(button - 1); |
1147 |
+ |
else if (button < 6) { // Wheel mouse |
1148 |
+ |
if (mouse_wheel_mode == 0) { |
1149 |
+ |
int key = (button == 5) ? 0x79 : 0x74; // Page up/down |
1150 |
+ |
ADBKeyDown(key); |
1151 |
+ |
ADBKeyUp(key); |
1152 |
+ |
} else { |
1153 |
+ |
int key = (button == 5) ? 0x3d : 0x3e; // Cursor up/down |
1154 |
+ |
for(int i=0; i<mouse_wheel_lines; i++) { |
1155 |
+ |
ADBKeyDown(key); |
1156 |
+ |
ADBKeyUp(key); |
1157 |
+ |
} |
1158 |
+ |
} |
1159 |
+ |
} |
1160 |
|
break; |
1161 |
|
} |
1162 |
|
case ButtonRelease: { |