2001-12-20 10:19:53 +01:00
|
|
|
$NetBSD: patch-at,v 1.2 2001/12/20 09:19:56 tron Exp $
|
2001-05-02 23:46:07 +02:00
|
|
|
|
2001-12-20 10:19:53 +01:00
|
|
|
--- lib/libxview/win/win_input.c.orig Mon Jun 27 00:27:53 1994
|
|
|
|
+++ lib/libxview/win/win_input.c Thu Dec 20 10:09:19 2001
|
|
|
|
@@ -56,6 +56,7 @@
|
|
|
|
static int GetButtonEvent();
|
|
|
|
static int win_translate_KP_keysym();
|
|
|
|
static int translate_key();
|
|
|
|
+static int xevent_to_event();
|
|
|
|
|
|
|
|
extern struct rectlist *win_get_damage();
|
|
|
|
extern void server_set_timestamp();
|
|
|
|
@@ -853,7 +854,9 @@
|
|
|
|
#ifdef X11R6
|
|
|
|
/* lumpi@dobag.in-berlin.de */
|
|
|
|
int ksym_pcc;
|
|
|
|
- XGetKeyboardMapping(display,NoSymbol,0,&ksym_pcc);
|
|
|
|
+ int tc_min_keycode, tc_max_keycode;
|
|
|
|
+ XDisplayKeycodes(display, &tc_min_keycode, &tc_max_keycode);
|
|
|
|
+ XGetKeyboardMapping(display,tc_min_keycode,tc_max_keycode-tc_min_keycode-1,&ksym_pcc);
|
|
|
|
for (index = 0; index < ksym_pcc; index++) {
|
|
|
|
#else
|
|
|
|
for (index = 0; index < display->keysyms_per_keycode; index++) {
|
|
|
|
@@ -861,7 +864,7 @@
|
|
|
|
if ((ksym = XLookupKeysym(ek, index)) != NoSymbol)
|
|
|
|
if (IsKeypadKey(ksym)) {
|
|
|
|
/* See if key has been rebound. */
|
|
|
|
- if (!translate_key(display, ksym, ek->state,
|
|
|
|
+ if (translate_key(display, ksym, ek->state,
|
|
|
|
buffer, BUFFERSIZE)) {
|
|
|
|
(void)win_translate_KP_keysym(ksym, buffer);
|
|
|
|
}
|
|
|
|
@@ -2720,8 +2723,10 @@
|
|
|
|
* Xlib's.
|
|
|
|
*/
|
|
|
|
|
|
|
|
-#ifdef X11R6
|
|
|
|
-/* lumpi@dobag.in-berlin.de */
|
|
|
|
+#ifdef X11R6
|
|
|
|
+/* lumpi@dobag.in-berlin.de
|
|
|
|
+ tom@sees.bangor.ac.uk this replacement for X11R6 doesn't work. At least
|
|
|
|
+ it should now return sensible values though. */
|
|
|
|
static int
|
|
|
|
translate_key(dpy, symbol, modifiers, buffer, nbytes)
|
|
|
|
Display *dpy;
|
|
|
|
@@ -2731,11 +2736,18 @@
|
|
|
|
int nbytes;
|
2001-05-02 23:46:07 +02:00
|
|
|
{
|
2001-12-20 10:19:53 +01:00
|
|
|
/* This is _very_ rude ! */
|
|
|
|
- strcpy(buffer,XKeysymToString(symbol));
|
|
|
|
+ char *string;
|
|
|
|
+ string = XKeysymToString(symbol);
|
|
|
|
+ if (string) {
|
|
|
|
+ strncpy(buffer,XKeysymToString(symbol),nbytes);
|
|
|
|
+ return(strlen(buffer));
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
-#else
|
2001-05-02 23:46:07 +02:00
|
|
|
|
2001-12-20 10:19:53 +01:00
|
|
|
+#else
|
|
|
|
static int
|
|
|
|
translate_key(dpy, symbol, modifiers, buffer, nbytes)
|
|
|
|
Display *dpy;
|
|
|
|
@@ -2761,4 +2773,4 @@
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
-#endif
|
|
|
|
+#endif
|