Mercurial > emacs
comparison src/xterm.c @ 555:e09a318cf838
*** empty log message ***
author | Jim Blandy <jimb@redhat.com> |
---|---|
date | Fri, 21 Feb 1992 05:39:59 +0000 |
parents | 2f2206ac3dba |
children | eca8812e61cd |
comparison
equal
deleted
inserted
replaced
554:e14686fb979e | 555:e09a318cf838 |
---|---|
63 #ifdef SIGIO | 63 #ifdef SIGIO |
64 #undef SIGIO | 64 #undef SIGIO |
65 #endif | 65 #endif |
66 #endif | 66 #endif |
67 | 67 |
68 #ifdef NEED_TIME_H | 68 #include "systime.h" |
69 #include <time.h> | |
70 #else /* not NEED_TIME_H */ | |
71 #ifdef HAVE_TIMEVAL | |
72 #include <sys/time.h> | |
73 #endif /* HAVE_TIMEVAL */ | |
74 #endif /* not NEED_TIME_H */ | |
75 | 69 |
76 #include <fcntl.h> | 70 #include <fcntl.h> |
77 #include <stdio.h> | 71 #include <stdio.h> |
78 #include <ctype.h> | 72 #include <ctype.h> |
79 #include <errno.h> | 73 #include <errno.h> |
1913 if (s != 0) | 1907 if (s != 0) |
1914 { | 1908 { |
1915 KeySym keysym; | 1909 KeySym keysym; |
1916 XComposeStatus status; | 1910 XComposeStatus status; |
1917 char copy_buffer[80]; | 1911 char copy_buffer[80]; |
1912 int modifiers = event.xkey.state; | |
1913 | |
1914 /* Some keyboards generate different characters | |
1915 depending on the state of the meta key, in an attempt | |
1916 to support non-English typists. It would be nice to | |
1917 keep this functionality somehow, but for now, we will | |
1918 just clear the meta-key flag to get the 'pure' character. */ | |
1919 event.xkey.state &= ~Mod1Mask; | |
1918 | 1920 |
1919 /* This will have to go some day... */ | 1921 /* This will have to go some day... */ |
1920 nbytes = XLookupString (&event.xkey, | 1922 nbytes = XLookupString (&event.xkey, |
1921 copy_buffer, | 1923 copy_buffer, |
1922 80, | 1924 80, |
1936 || IsFunctionKey (keysym)) /* 0xffbe <= x < 0xffe1 */ | 1938 || IsFunctionKey (keysym)) /* 0xffbe <= x < 0xffe1 */ |
1937 { | 1939 { |
1938 bufp->kind = non_ascii_keystroke; | 1940 bufp->kind = non_ascii_keystroke; |
1939 XSET (bufp->code, Lisp_Int, (unsigned) keysym - 0xff50); | 1941 XSET (bufp->code, Lisp_Int, (unsigned) keysym - 0xff50); |
1940 bufp->screen = XSCREEN (SCREEN_FOCUS_SCREEN (s)); | 1942 bufp->screen = XSCREEN (SCREEN_FOCUS_SCREEN (s)); |
1941 bufp->modifiers = x_convert_modifiers (event.xkey.state); | 1943 bufp->modifiers = x_convert_modifiers (modifiers); |
1942 XSET (bufp->timestamp, Lisp_Int, event.xkey.time); | 1944 XSET (bufp->timestamp, Lisp_Int, event.xkey.time); |
1943 bufp++; | 1945 bufp++; |
1944 count++; | 1946 count++; |
1945 numchars--; | 1947 numchars--; |
1946 } | 1948 } |
1948 { | 1950 { |
1949 register int i; | 1951 register int i; |
1950 | 1952 |
1951 if (nbytes == 1) | 1953 if (nbytes == 1) |
1952 { | 1954 { |
1953 if (event.xkey.state & Mod1Mask) | 1955 if (modifiers & Mod1Mask) |
1954 *copy_buffer |= METABIT; | 1956 *copy_buffer |= METABIT; |
1955 bufp->kind = ascii_keystroke; | 1957 bufp->kind = ascii_keystroke; |
1956 bufp->screen = XSCREEN (SCREEN_FOCUS_SCREEN (s)); | 1958 bufp->screen = XSCREEN (SCREEN_FOCUS_SCREEN (s)); |
1957 XSET (bufp->code, Lisp_Int, *copy_buffer); | 1959 XSET (bufp->code, Lisp_Int, *copy_buffer); |
1958 XSET (bufp->timestamp, Lisp_Int, event.xkey.time); | 1960 XSET (bufp->timestamp, Lisp_Int, event.xkey.time); |
2299 | 2301 |
2300 int fd = ConnectionNumber (x_current_display); | 2302 int fd = ConnectionNumber (x_current_display); |
2301 int mask = 1 << fd; | 2303 int mask = 1 << fd; |
2302 | 2304 |
2303 if (0 != select (fd + 1, &mask, (long *) 0, (long *) 0, | 2305 if (0 != select (fd + 1, &mask, (long *) 0, (long *) 0, |
2304 (struct timeval *) 0) | 2306 (EMACS_TIME) 0) |
2305 && !XStuffPending ()) | 2307 && !XStuffPending ()) |
2306 kill (getpid (), SIGHUP); | 2308 kill (getpid (), SIGHUP); |
2307 } | 2309 } |
2308 #endif /* HAVE_SELECT */ | 2310 #endif /* HAVE_SELECT */ |
2309 #endif | 2311 #endif |