summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjmcneill <jmcneill>2015-01-29 11:28:50 +0000
committerjmcneill <jmcneill>2015-01-29 11:28:50 +0000
commit34f8d7bfa060ce2e3babd7bd22346e57eb607808 (patch)
treeb04cca3e0e478a727132e3611ea3686b34845dd8
parent11c8de95ccdf658ce7de247ad75a5c4f2d7097a8 (diff)
downloadpkgsrc-34f8d7bfa060ce2e3babd7bd22346e57eb607808.tar.gz
fix wscons keyboard
-rw-r--r--devel/SDL/distinfo6
-rw-r--r--devel/SDL/patches/patch-src_video_wscons_SDL__wsconsevents.c128
-rw-r--r--devel/SDL/patches/patch-src_video_wscons_SDL__wsconsvideo.h10
3 files changed, 63 insertions, 81 deletions
diff --git a/devel/SDL/distinfo b/devel/SDL/distinfo
index 3e3d3832ddc..90787c57ce2 100644
--- a/devel/SDL/distinfo
+++ b/devel/SDL/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.68 2015/01/29 01:56:02 jmcneill Exp $
+$NetBSD: distinfo,v 1.69 2015/01/29 11:28:50 jmcneill Exp $
SHA1 (SDL-1.2.15.tar.gz) = 0c5f193ced810b0d7ce3ab06d808cbb5eef03a2c
RMD160 (SDL-1.2.15.tar.gz) = d4802a090cb4a24eeb0c8ce5690802f596d394c3
@@ -8,8 +8,8 @@ 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) = f7519864e9c13ad69eae9a42df22a944586ab93b
+SHA1 (patch-src_video_wscons_SDL__wsconsevents.c) = 1205a549f4ba1f1bc7185081407f79545421e75e
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) = 82028df57cf3de95152278924ffe3134fe32f85a
+SHA1 (patch-src_video_wscons_SDL__wsconsvideo.h) = efc75da910cfe370b7361a0b9d2b90837c6b9aa9
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 42775408128..713dee22517 100644
--- a/devel/SDL/patches/patch-src_video_wscons_SDL__wsconsevents.c
+++ b/devel/SDL/patches/patch-src_video_wscons_SDL__wsconsevents.c
@@ -1,8 +1,8 @@
-$NetBSD: patch-src_video_wscons_SDL__wsconsevents.c,v 1.6 2015/01/29 01:56:02 jmcneill Exp $
+$NetBSD: patch-src_video_wscons_SDL__wsconsevents.c,v 1.7 2015/01/29 11:28:50 jmcneill Exp $
--- src/video/wscons/SDL_wsconsevents.c.orig 2012-01-19 06:30:06.000000000 +0000
+++ src/video/wscons/SDL_wsconsevents.c
-@@ -47,6 +47,13 @@ int WSCONS_InitKeyboard(_THIS)
+@@ -47,14 +47,31 @@ int WSCONS_InitKeyboard(_THIS)
return -1;
}
@@ -16,21 +16,58 @@ $NetBSD: patch-src_video_wscons_SDL__wsconsevents.c,v 1.6 2015/01/29 01:56:02 jm
if (tcgetattr(private->fd, &private->saved_tty) == -1) {
WSCONS_ReportError("cannot get terminal attributes: %s", strerror(errno));
return -1;
-@@ -65,6 +72,7 @@ int WSCONS_InitKeyboard(_THIS)
+ }
++ if (ioctl(private->fd, WSKBDIO_GETKEYREPEAT, &private->saved_repeat) == -1) {
++ WSCONS_ReportError("cannot get repeat settings: %s", strerror(errno));
++ return -1;
++ }
+ private->did_save_tty = 1;
++
++ if (ioctl(private->fd, KDSKBMODE, K_RAW) == -1) {
++ WSCONS_ReportError("cannot set raw keyboard mode: %s", strerror(errno));
++ return -1;
++ }
++
+ tty = private->saved_tty;
+ tty.c_iflag = IGNPAR | IGNBRK;
+- tty.c_oflag = 0;
++ //tty.c_oflag = 0;
+ tty.c_cflag = CREAD | CS8;
+ tty.c_lflag = 0;
+ tty.c_cc[VTIME] = 0;
+@@ -65,8 +82,12 @@ int WSCONS_InitKeyboard(_THIS)
WSCONS_ReportError("cannot set terminal attributes: %s", strerror(errno));
return -1;
}
+- if (ioctl(private->fd, KDSKBMODE, K_RAW) == -1) {
+- WSCONS_ReportError("cannot set raw keyboard mode: %s", strerror(errno));
+
- if (ioctl(private->fd, KDSKBMODE, K_RAW) == -1) {
- WSCONS_ReportError("cannot set raw keyboard mode: %s", strerror(errno));
++ struct wskbd_keyrepeat_data repeat;
++ repeat.which = WSKBD_KEYREPEAT_DOALL;
++ repeat.del1 = repeat.delN = UINT_MAX;
++ if (ioctl(private->fd, WSKBDIO_SETKEYREPEAT, &repeat) == -1) {
++ WSCONS_ReportError("cannot set repeat settings: %s", strerror(errno));
return -1;
-@@ -89,8 +97,57 @@ void WSCONS_ReleaseKeyboard(_THIS)
+ }
+
+@@ -81,6 +102,10 @@ void WSCONS_ReleaseKeyboard(_THIS)
+ strerror(errno));
+ }
+ if (private->did_save_tty) {
++ if (ioctl(private->fd, WSKBDIO_SETKEYREPEAT, &private->saved_repeat) == -1) {
++ WSCONS_ReportError("cannot restore repeat settings: %s",
++ strerror(errno));
++ }
+ 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)
}
}
-static void updateMouse()
+int WSCONS_InitMouse(_THIS)
-+{
+ {
+ if (private->mouseFd != -1) {
+#if defined(WSMOUSEIO_SETVERSION)
+ int version = WSMOUSE_EVENT_VERSION;
@@ -50,7 +87,7 @@ $NetBSD: patch-src_video_wscons_SDL__wsconsevents.c,v 1.6 2015/01/29 01:56:02 jm
+#define NUMEVENTS 64
+
+static void updateMouse(_THIS)
- {
++{
+ struct wscons_event evlist[NUMEVENTS];
+ struct wscons_event *ev = evlist;
+ int nev, i;
@@ -83,7 +120,7 @@ $NetBSD: patch-src_video_wscons_SDL__wsconsevents.c,v 1.6 2015/01/29 01:56:02 jm
}
static SDLKey keymap[128];
-@@ -120,19 +177,42 @@ static void updateKeyboard(_THIS)
+@@ -120,19 +194,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?
@@ -130,86 +167,23 @@ $NetBSD: patch-src_video_wscons_SDL__wsconsevents.c,v 1.6 2015/01/29 01:56:02 jm
} while (posted);
}
-@@ -146,7 +226,72 @@ void WSCONS_InitOSKeymap(_THIS)
+@@ -146,8 +243,10 @@ void WSCONS_InitOSKeymap(_THIS)
}
switch (private->kbdType) {
-#ifdef WSKBD_TYPE_ZAURUS
-+ 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
++ case WSKBD_TYPE_USB:
/* top row */
keymap[2] = SDLK_1;
-@@ -220,7 +365,7 @@ void WSCONS_InitOSKeymap(_THIS)
+ keymap[3] = SDLK_2;
+@@ -220,7 +319,6 @@ void WSCONS_InitOSKeymap(_THIS)
keymap[77] = SDLK_RIGHT;
keymap[80] = SDLK_DOWN;
break;
-#endif /* WSKBD_TYPE_ZAURUS */
-+#endif
default:
WSCONS_ReportError("Unable to map keys for keyboard type %u",
diff --git a/devel/SDL/patches/patch-src_video_wscons_SDL__wsconsvideo.h b/devel/SDL/patches/patch-src_video_wscons_SDL__wsconsvideo.h
index ba25bbfd3ba..1087f981841 100644
--- a/devel/SDL/patches/patch-src_video_wscons_SDL__wsconsvideo.h
+++ b/devel/SDL/patches/patch-src_video_wscons_SDL__wsconsvideo.h
@@ -1,4 +1,4 @@
-$NetBSD: patch-src_video_wscons_SDL__wsconsvideo.h,v 1.1 2015/01/29 01:56:23 jmcneill Exp $
+$NetBSD: patch-src_video_wscons_SDL__wsconsvideo.h,v 1.2 2015/01/29 11:28:50 jmcneill Exp $
--- src/video/wscons/SDL_wsconsvideo.h.orig 2012-01-19 06:30:06.000000000 +0000
+++ src/video/wscons/SDL_wsconsvideo.h
@@ -10,3 +10,11 @@ $NetBSD: patch-src_video_wscons_SDL__wsconsvideo.h,v 1.1 2015/01/29 01:56:23 jmc
struct wsdisplay_fbinfo info; /* frame buffer characteristics */
int physlinebytes; /* number of bytes per row */
int redMask, greenMask, blueMask;
+@@ -70,6 +71,7 @@ struct SDL_PrivateVideoData {
+ unsigned int kbdType;
+ int did_save_tty;
+ struct termios saved_tty;
++ struct wskbd_keyrepeat_data saved_repeat;
+ };
+
+