diff options
author | jmcneill <jmcneill@pkgsrc.org> | 2015-01-28 17:14:47 +0000 |
---|---|---|
committer | jmcneill <jmcneill@pkgsrc.org> | 2015-01-28 17:14:47 +0000 |
commit | 6f96878dd7db426c01526df7828927427f79d2ea (patch) | |
tree | 2519f713e73e3d3224bfa250e05173660bbb87f9 | |
parent | 011e0c96bb3944390d6eef4770d865f0d1f50de6 (diff) | |
download | pkgsrc-6f96878dd7db426c01526df7828927427f79d2ea.tar.gz |
Add USB keyboard support to the wscons driver.
-rw-r--r-- | devel/SDL/Makefile | 4 | ||||
-rw-r--r-- | devel/SDL/distinfo | 4 | ||||
-rw-r--r-- | devel/SDL/patches/patch-src_video_wscons_SDL__wsconsevents.c | 101 |
3 files changed, 89 insertions, 20 deletions
diff --git a/devel/SDL/Makefile b/devel/SDL/Makefile index 813fe10d7fe..367fb6043a2 100644 --- a/devel/SDL/Makefile +++ b/devel/SDL/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.117 2014/10/09 14:06:07 wiz Exp $ +# $NetBSD: Makefile,v 1.118 2015/01/28 17:14:47 jmcneill Exp $ DISTNAME= SDL-1.2.15 -PKGREVISION= 12 +PKGREVISION= 13 CATEGORIES= devel games MASTER_SITES= http://www.libsdl.org/release/ diff --git a/devel/SDL/distinfo b/devel/SDL/distinfo index 33cbf17366e..147c17cd04a 100644 --- a/devel/SDL/distinfo +++ b/devel/SDL/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.66 2014/08/17 09:24:47 wiz Exp $ +$NetBSD: distinfo,v 1.67 2015/01/28 17:14:47 jmcneill Exp $ SHA1 (SDL-1.2.15.tar.gz) = 0c5f193ced810b0d7ce3ab06d808cbb5eef03a2c RMD160 (SDL-1.2.15.tar.gz) = d4802a090cb4a24eeb0c8ce5690802f596d394c3 @@ -8,6 +8,6 @@ SHA1 (patch-ac) = 8b2dddff9ad449b19b35ef364e2d960e46284563 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) = e1595611542f3ffaebfe32ee611596c18c06be5e +SHA1 (patch-src_video_wscons_SDL__wsconsevents.c) = 6ae894622078c2cc2a0add0b496944567d38f797 SHA1 (patch-src_video_wscons_SDL__wsconsvideo.c) = 356a8817cc41dde5e24cb23f032215931f85a84b SHA1 (patch-src_video_x11_SDL_x11video.c) = 624fbb7e701d6de6ec93096beea7c085125934aa diff --git a/devel/SDL/patches/patch-src_video_wscons_SDL__wsconsevents.c b/devel/SDL/patches/patch-src_video_wscons_SDL__wsconsevents.c index 8c493efcbf4..6f87837c460 100644 --- a/devel/SDL/patches/patch-src_video_wscons_SDL__wsconsevents.c +++ b/devel/SDL/patches/patch-src_video_wscons_SDL__wsconsevents.c @@ -1,34 +1,103 @@ -$NetBSD: patch-src_video_wscons_SDL__wsconsevents.c,v 1.4 2012/01/28 10:33:31 wiz Exp $ +$NetBSD: patch-src_video_wscons_SDL__wsconsevents.c,v 1.5 2015/01/28 17:14:47 jmcneill Exp $ -"Port" to NetBSD. +Add support for USB keyboards on NetBSD. --- src/video/wscons/SDL_wsconsevents.c.orig 2012-01-19 06:30:06.000000000 +0000 +++ src/video/wscons/SDL_wsconsevents.c -@@ -146,8 +146,11 @@ void WSCONS_InitOSKeymap(_THIS) +@@ -47,6 +47,13 @@ int WSCONS_InitKeyboard(_THIS) + return -1; + } + ++#if defined(__NetBSD__) ++ if (private->kbdType == 0) { ++ /* wsmux with no keyboard attached, assumed USB */ ++ private->kbdType = WSKBD_TYPE_USB; ++ } ++#endif ++ + if (tcgetattr(private->fd, &private->saved_tty) == -1) { + WSCONS_ReportError("cannot get terminal attributes: %s", strerror(errno)); + return -1; +@@ -146,7 +153,72 @@ void WSCONS_InitOSKeymap(_THIS) } switch (private->kbdType) { -#ifdef WSKBD_TYPE_ZAURUS -+#if defined(__NetBSD__) || !defined(WSKBD_TYPE_ZAURUS) -+ default: -+#else ++ case WSKBD_TYPE_USB: ++ for (i=4; i <= 29; i++) { ++ keymap[i] = SDLK_a + (i-4); ++ } ++ for (i=30; i <= 38; i++) { ++ keymap[i] = SDLK_1 + (i-30); ++ } ++ keymap[39] = SDLK_0; ++ keymap[40] = SDLK_RETURN; ++ keymap[41] = SDLK_ESCAPE; ++ keymap[42] = SDLK_BACKSPACE; ++ keymap[43] = SDLK_TAB; ++ keymap[44] = SDLK_SPACE; ++ keymap[45] = SDLK_MINUS; ++ keymap[46] = SDLK_EQUALS; ++ keymap[47] = SDLK_LEFTBRACKET; ++ keymap[48] = SDLK_RIGHTBRACKET; ++ keymap[49] = SDLK_BACKSLASH; ++ keymap[50] = SDLK_BACKSLASH; ++ keymap[51] = SDLK_SEMICOLON; ++ keymap[52] = SDLK_QUOTE; ++ keymap[53] = SDLK_BACKQUOTE; ++ keymap[54] = SDLK_COMMA; ++ keymap[55] = SDLK_PERIOD; ++ keymap[56] = SDLK_SLASH; ++ keymap[57] = SDLK_CAPSLOCK; ++ for (i=58; i <= 69; i++) { ++ keymap[i] = SDLK_F1 + (i-58); ++ } ++ keymap[70] = SDLK_PRINT; ++ keymap[71] = SDLK_SCROLLOCK; ++ keymap[72] = SDLK_PAUSE; ++ keymap[73] = SDLK_INSERT; ++ keymap[74] = SDLK_HOME; ++ keymap[75] = SDLK_PAGEUP; ++ keymap[76] = SDLK_DELETE; ++ keymap[77] = SDLK_END; ++ keymap[78] = SDLK_PAGEDOWN; ++ keymap[79] = SDLK_RIGHT; ++ keymap[80] = SDLK_LEFT; ++ keymap[81] = SDLK_DOWN; ++ keymap[82] = SDLK_UP; ++ keymap[83] = SDLK_NUMLOCK; ++ keymap[84] = SDLK_KP_DIVIDE; ++ keymap[85] = SDLK_KP_MULTIPLY; ++ keymap[86] = SDLK_KP_MINUS; ++ keymap[87] = SDLK_KP_PLUS; ++ keymap[88] = SDLK_KP_ENTER; ++ for (i=89; i <= 97; i++) { ++ keymap[i] = SDLK_KP1 + (i-89); ++ } ++ keymap[98] = SDLK_KP0; ++ keymap[99] = SDLK_KP_PERIOD; ++ keymap[100] = SDLK_LESS; ++ keymap[101] = SDLK_MENU; ++ keymap[102] = SDLK_POWER; ++ keymap[103] = SDLK_KP_EQUALS; ++ keymap[104] = SDLK_F13; ++ keymap[105] = SDLK_F14; ++ keymap[106] = SDLK_F15; ++ keymap[109] = SDLK_POWER; ++ keymap[117] = SDLK_HELP; ++ ++ break; ++ ++#if defined(WSKBD_TYPE_ZAURUS) case WSKBD_TYPE_ZAURUS: -+#endif /* top row */ keymap[2] = SDLK_1; - keymap[3] = SDLK_2; -@@ -220,12 +223,13 @@ void WSCONS_InitOSKeymap(_THIS) +@@ -220,7 +292,7 @@ void WSCONS_InitOSKeymap(_THIS) keymap[77] = SDLK_RIGHT; keymap[80] = SDLK_DOWN; break; -#endif /* WSKBD_TYPE_ZAURUS */ ++#endif -+#if !defined(__NetBSD__) && defined(WSKBD_TYPE_ZAURUS) default: WSCONS_ReportError("Unable to map keys for keyboard type %u", - private->kbdType); - break; -+#endif - } - } - |