pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/devel/SDL add wsmouse mousewheel support



details:   https://anonhg.NetBSD.org/pkgsrc/rev/6f10a364c8ef
branches:  trunk
changeset: 645516:6f10a364c8ef
user:      jmcneill <jmcneill%pkgsrc.org@localhost>
date:      Thu Jan 29 12:31:07 2015 +0000

description:
add wsmouse mousewheel support

diffstat:

 devel/SDL/distinfo                                           |   4 +-
 devel/SDL/patches/patch-src_video_wscons_SDL__wsconsevents.c |  20 ++++++++---
 2 files changed, 16 insertions(+), 8 deletions(-)

diffs (85 lines):

diff -r 80c0190fbb28 -r 6f10a364c8ef devel/SDL/distinfo
--- a/devel/SDL/distinfo        Thu Jan 29 12:29:01 2015 +0000
+++ b/devel/SDL/distinfo        Thu Jan 29 12:31:07 2015 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.70 2015/01/29 12:22:04 jmcneill Exp $
+$NetBSD: distinfo,v 1.71 2015/01/29 12:31:07 jmcneill Exp $
 
 SHA1 (SDL-1.2.15.tar.gz) = 0c5f193ced810b0d7ce3ab06d808cbb5eef03a2c
 RMD160 (SDL-1.2.15.tar.gz) = d4802a090cb4a24eeb0c8ce5690802f596d394c3
@@ -8,7 +8,7 @@
 SHA1 (patch-src_audio_sun_SDL__sunaudio.c) = 4b492b40d39e6444037dfda55766e4a149cc6c30
 SHA1 (patch-src_joystick_bsd_SDL__sysjoystick.c) = 4ea0136f231729129b82e5f7ee4b9eaf68a13876
 SHA1 (patch-src_video_quartz_SDL__QuartzVideo.h) = 19d952bade06dbd646e94f42139c38436969b1a8
-SHA1 (patch-src_video_wscons_SDL__wsconsevents.c) = 459a72044beba6655298b5ef2b4a5073a2fdb9a8
+SHA1 (patch-src_video_wscons_SDL__wsconsevents.c) = 216a07cbfb99e1f3d6fe2da191922be76cb09759
 SHA1 (patch-src_video_wscons_SDL__wsconsevents__c.h) = 97206e2aca0b620005217d9d07ad1177516cac92
 SHA1 (patch-src_video_wscons_SDL__wsconsvideo.c) = 17e048ccb201ae961e820ab880d5a588b2db2639
 SHA1 (patch-src_video_wscons_SDL__wsconsvideo.h) = efc75da910cfe370b7361a0b9d2b90837c6b9aa9
diff -r 80c0190fbb28 -r 6f10a364c8ef devel/SDL/patches/patch-src_video_wscons_SDL__wsconsevents.c
--- a/devel/SDL/patches/patch-src_video_wscons_SDL__wsconsevents.c      Thu Jan 29 12:29:01 2015 +0000
+++ b/devel/SDL/patches/patch-src_video_wscons_SDL__wsconsevents.c      Thu Jan 29 12:31:07 2015 +0000
@@ -1,4 +1,4 @@
-$NetBSD: patch-src_video_wscons_SDL__wsconsevents.c,v 1.8 2015/01/29 12:22:04 jmcneill Exp $
+$NetBSD: patch-src_video_wscons_SDL__wsconsevents.c,v 1.9 2015/01/29 12:31:08 jmcneill Exp $
 
 --- src/video/wscons/SDL_wsconsevents.c.orig   2012-01-19 06:30:06.000000000 +0000
 +++ src/video/wscons/SDL_wsconsevents.c
@@ -61,7 +61,7 @@
        if (tcsetattr(private->fd, TCSANOW, &private->saved_tty) < 0) {
        WSCONS_ReportError("cannot restore keynoard attributes: %s",
                           strerror(errno));
-@@ -89,8 +114,57 @@ void WSCONS_ReleaseKeyboard(_THIS)
+@@ -89,8 +114,65 @@ void WSCONS_ReleaseKeyboard(_THIS)
    }
  }
  
@@ -115,12 +115,20 @@
 +    case WSCONS_EVENT_MOUSE_DELTA_Y:
 +      posted += SDL_PrivateMouseMotion(0, 1, 0, -ev->value);
 +      break;
++    case WSCONS_EVENT_MOUSE_DELTA_Z:
++      posted += SDL_PrivateMouseButton(SDL_PRESSED,
++                    ev->value > 0 ? SDL_BUTTON_WHEELUP : SDL_BUTTON_WHEELDOWN,
++                    0, 0);
++      posted += SDL_PrivateMouseButton(SDL_RELEASED,
++                    ev->value > 0 ? SDL_BUTTON_WHEELUP : SDL_BUTTON_WHEELDOWN,
++                    0, 0);
++      break;
 +    }
 +  }
  }
  
  static SDLKey keymap[128];
-@@ -107,6 +181,11 @@ static SDL_keysym *TranslateKey(int scan
+@@ -107,6 +189,11 @@ static SDL_keysym *TranslateKey(int scan
    if (keysym->sym == SDLK_UNKNOWN)
      printf("Unknown mapping for scancode %d\n", scancode);
  
@@ -132,7 +140,7 @@
    return keysym;
  }
  
-@@ -120,19 +199,42 @@ static void updateKeyboard(_THIS)
+@@ -120,19 +207,42 @@ static void updateKeyboard(_THIS)
      for (i = 0; i < n; i++) {
        unsigned char c = buf[i] & 0x7f;
        if (c == 224) // special key prefix -- what should we do with it?
@@ -179,7 +187,7 @@
    } while (posted);
  }
  
-@@ -146,8 +248,10 @@ void WSCONS_InitOSKeymap(_THIS)
+@@ -146,8 +256,10 @@ void WSCONS_InitOSKeymap(_THIS)
    }
  
    switch (private->kbdType) {
@@ -191,7 +199,7 @@
      /* top row */
      keymap[2] = SDLK_1;
      keymap[3] = SDLK_2;
-@@ -220,7 +324,6 @@ void WSCONS_InitOSKeymap(_THIS)
+@@ -220,7 +332,6 @@ void WSCONS_InitOSKeymap(_THIS)
      keymap[77] = SDLK_RIGHT;
      keymap[80] = SDLK_DOWN;
      break;



Home | Main Index | Thread Index | Old Index