Lines 24-29
Link Here
|
24 |
// undefine to restrict windowed resolutions to conventional sizes |
24 |
// undefine to restrict windowed resolutions to conventional sizes |
25 |
#define ANY_WINDOWED_SIZE |
25 |
#define ANY_WINDOWED_SIZE |
26 |
|
26 |
|
|
|
27 |
// fix for mousewheel |
28 |
#define MWHEELTICKS 10 |
29 |
static unsigned long mwheelup, mwheeldown; |
30 |
|
27 |
int _buildargc = 1; |
31 |
int _buildargc = 1; |
28 |
char **_buildargv = NULL; |
32 |
char **_buildargv = NULL; |
29 |
extern long app_main(long argc, char *argv[]); |
33 |
extern long app_main(long argc, char *argv[]); |
Lines 486-493
Link Here
|
486 |
initprintf("Initialising mouse\n"); |
490 |
initprintf("Initialising mouse\n"); |
487 |
|
491 |
|
488 |
// grab input |
492 |
// grab input |
489 |
grabmouse(1); |
|
|
490 |
moustat=1; |
493 |
moustat=1; |
|
|
494 |
grabmouse(1); |
491 |
|
495 |
|
492 |
return 0; |
496 |
return 0; |
493 |
} |
497 |
} |
Lines 1363-1376
Link Here
|
1363 |
case SDL_BUTTON_LEFT: j = 0; break; |
1367 |
case SDL_BUTTON_LEFT: j = 0; break; |
1364 |
case SDL_BUTTON_RIGHT: j = 1; break; |
1368 |
case SDL_BUTTON_RIGHT: j = 1; break; |
1365 |
case SDL_BUTTON_MIDDLE: j = 2; break; |
1369 |
case SDL_BUTTON_MIDDLE: j = 2; break; |
1366 |
default: j = -1; break; |
1370 |
default: j = ev.button.button; break; |
1367 |
} |
1371 |
} |
1368 |
if (j<0) break; |
1372 |
if (j<0) break; |
1369 |
|
1373 |
|
1370 |
if (ev.button.state == SDL_PRESSED) |
1374 |
if (ev.button.state == SDL_PRESSED) { |
|
|
1375 |
if (ev.button.button == SDL_BUTTON_WHEELUP) { |
1376 |
mwheelup = totalclock; |
1377 |
} |
1378 |
if (ev.button.button == SDL_BUTTON_WHEELDOWN) { |
1379 |
mwheeldown = totalclock; |
1380 |
} |
1371 |
mouseb |= (1<<j); |
1381 |
mouseb |= (1<<j); |
1372 |
else |
1382 |
} |
1373 |
mouseb &= ~(1<<j); |
1383 |
else { |
|
|
1384 |
if (j < 4) mouseb &= ~(1<<j); |
1385 |
} |
1374 |
|
1386 |
|
1375 |
if (mousepresscallback) |
1387 |
if (mousepresscallback) |
1376 |
mousepresscallback(j+1, ev.button.state == SDL_PRESSED); |
1388 |
mousepresscallback(j+1, ev.button.state == SDL_PRESSED); |
Lines 1435-1440
Link Here
|
1435 |
|
1447 |
|
1436 |
sampletimer(); |
1448 |
sampletimer(); |
1437 |
|
1449 |
|
|
|
1450 |
if (moustat) { |
1451 |
if ((mwheelup) && (mwheelup <= (totalclock - MWHEELTICKS))) { |
1452 |
mouseb &= ~16; |
1453 |
mwheelup = 0; |
1454 |
} |
1455 |
if ((mwheeldown) && (mwheeldown <= (totalclock - MWHEELTICKS))) { |
1456 |
mouseb &= ~32; |
1457 |
mwheeldown = 0; |
1458 |
} |
1459 |
} |
1460 |
|
1438 |
#ifdef HAVE_GTK2 |
1461 |
#ifdef HAVE_GTK2 |
1439 |
if (gtkenabled) update_startwin(); |
1462 |
if (gtkenabled) update_startwin(); |
1440 |
#endif |
1463 |
#endif |