From: Arthur Gleckler Date: Tue, 6 Aug 1991 15:12:05 +0000 (+0000) Subject: Upgrade microcode to pass X keysyms in keyboard events through to Edwin. X-Git-Tag: 20090517-FFI~10408 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=e661c68c79e91e8345d757181dfe12c94902296e;p=mit-scheme.git Upgrade microcode to pass X keysyms in keyboard events through to Edwin. --- diff --git a/v7/src/microcode/version.h b/v7/src/microcode/version.h index 8a7f23f06..996219ffd 100644 --- a/v7/src/microcode/version.h +++ b/v7/src/microcode/version.h @@ -1,6 +1,6 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/version.h,v 11.91 1991/07/24 19:47:41 jinx Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/version.h,v 11.92 1991/08/06 15:12:05 arthur Exp $ Copyright (c) 1988-91 Massachusetts Institute of Technology @@ -46,5 +46,5 @@ MIT in each case. */ #define VERSION 11 #endif #ifndef SUBVERSION -#define SUBVERSION 91 +#define SUBVERSION 92 #endif diff --git a/v7/src/microcode/x11base.c b/v7/src/microcode/x11base.c index 7f9c3c2c8..4b79c8947 100644 --- a/v7/src/microcode/x11base.c +++ b/v7/src/microcode/x11base.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/x11base.c,v 1.24 1991/07/26 21:52:37 arthur Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/x11base.c,v 1.25 1991/08/06 15:11:28 arthur Exp $ Copyright (c) 1989-91 Massachusetts Institute of Technology @@ -543,6 +543,8 @@ enum event_type #define EVENT_2 4 #define EVENT_3 5 +#define EVENT_EXTRA(max_event) (max_event - 1) + #define EVENT_INTEGER(event, slot, number) \ VECTOR_SET ((event), (slot), (long_to_integer (number))) @@ -625,28 +627,37 @@ DEFUN (key_event, (xw, event, type), (sizeof (copy_buffer)), (&keysym), (&compose_status))); - if ((nbytes < 1) || (IsModifierKey (keysym))) + if (IsModifierKey (keysym)) return (SHARP_F); else { long bucky = 0; - SCHEME_OBJECT result = (make_event_object (xw, type, 2)); - if (nbytes == 1) - { - /* Convert to Scheme bucky bits (kept independent of the */ - /* character). Let X handle controlification. */ - if ((event -> state) & Mod1Mask) /* Meta */ - bucky |= 1; - if ((event -> state) & Mod2Mask) /* Super */ - bucky |= 4; - if ((event -> state) & Mod3Mask) /* Hyper */ - bucky |= 8; - if ((event -> state) & Mod4Mask) /* Top */ - bucky |= 16; - } + SCHEME_OBJECT result + = (make_event_object (xw, type, EVENT_EXTRA (EVENT_2))); + + /* Create Scheme bucky bits (kept independent of the */ + /* character). X has already controlified, so Scheme may */ + /* choose to ignore the control bucky bit. */ + if ((event -> state) & Mod1Mask) /* Meta */ + bucky |= 1; + if ((event -> state) & ControlMask) /* Control */ + bucky |= 2; + if ((event -> state) & Mod2Mask) /* Super */ + bucky |= 4; + if ((event -> state) & Mod3Mask) /* Hyper */ + bucky |= 8; + if ((event -> state) & Mod4Mask) /* Top */ + bucky |= 16; VECTOR_SET (result, EVENT_0, (memory_to_string (nbytes, copy_buffer))); VECTOR_SET (result, EVENT_1, LONG_TO_UNSIGNED_FIXNUM (bucky)); + /* Move vendor-specific bit from bit 28 (zero-based) to bit 23 */ + /* so that all keysym values will fit in Scheme fixnums. */ + VECTOR_SET + (result, + EVENT_2, + LONG_TO_UNSIGNED_FIXNUM ((keysym & 0xffffff) + | (0x800000 & (keysym >> 5)))); return (result); } } diff --git a/v8/src/microcode/version.h b/v8/src/microcode/version.h index 46d8c37b5..62547bb7b 100644 --- a/v8/src/microcode/version.h +++ b/v8/src/microcode/version.h @@ -1,6 +1,6 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/version.h,v 11.91 1991/07/24 19:47:41 jinx Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/version.h,v 11.92 1991/08/06 15:12:05 arthur Exp $ Copyright (c) 1988-91 Massachusetts Institute of Technology @@ -46,5 +46,5 @@ MIT in each case. */ #define VERSION 11 #endif #ifndef SUBVERSION -#define SUBVERSION 91 +#define SUBVERSION 92 #endif