comparison src/events.h @ 2828:a25c824ed558

[xemacs-hg @ 2005-06-26 18:04:49 by aidan] Rename the ascii-character property, support more keysyms.
author aidan
date Sun, 26 Jun 2005 18:05:05 +0000
parents 6fa9919a9a0b
children 1e7cc382eb16
comparison
equal deleted inserted replaced
2827:936a6576c655 2828:a25c824ed558
106 } emacs_event_type; 106 } emacs_event_type;
107 107
108 #define first_event_type empty_event 108 #define first_event_type empty_event
109 #define last_event_type dead_event 109 #define last_event_type dead_event
110 110
111 #ifdef MULE
112
113 enum alternative_key_chars 111 enum alternative_key_chars
114 { 112 {
115 KEYCHAR_CURRENT_LANGENV, 113 KEYCHAR_CURRENT_LANGENV,
116 KEYCHAR_DEFAULT_USER, 114 KEYCHAR_DEFAULT_USER,
117 KEYCHAR_DEFAULT_SYSTEM, 115 KEYCHAR_DEFAULT_SYSTEM,
120 KEYCHAR_UNDERLYING_VIRTUAL_KEY_DEFAULT_SYSTEM, 118 KEYCHAR_UNDERLYING_VIRTUAL_KEY_DEFAULT_SYSTEM,
121 KEYCHAR_QWERTY, 119 KEYCHAR_QWERTY,
122 KEYCHAR_LAST 120 KEYCHAR_LAST
123 }; 121 };
124 122
125 #endif /* MULE */
126
127 struct Lisp_Key_Data 123 struct Lisp_Key_Data
128 { 124 {
129 #ifdef EVENT_DATA_AS_OBJECTS 125 #ifdef EVENT_DATA_AS_OBJECTS
130 struct lrecord_header lheader; 126 struct lrecord_header lheader;
131 #endif /* EVENT_DATA_AS_OBJECTS */ 127 #endif /* EVENT_DATA_AS_OBJECTS */
133 Lisp_Object keysym; 129 Lisp_Object keysym;
134 /* Modifiers held down when key was pressed: control, meta, etc. 130 /* Modifiers held down when key was pressed: control, meta, etc.
135 Also includes buttons. For many keys, Shift is not a bit; that 131 Also includes buttons. For many keys, Shift is not a bit; that
136 is implicit in the keyboard layout. */ 132 is implicit in the keyboard layout. */
137 int modifiers; 133 int modifiers;
138 #ifdef MULE
139 /* Alternate character interpretations for this key in different 134 /* Alternate character interpretations for this key in different
140 keyboard layouts. This deals with the problem of pressing C-x in 135 keyboard layouts. This deals with the problem of pressing C-x in
141 the Russian layout (the so-called "Russian C-x problem"), for 136 the Russian layout (the so-called "Russian C-x problem"), for
142 example: `x' gets mapped to a Cyrillic character, so what do we 137 example: `x' gets mapped to a Cyrillic character, so what do we
143 do? For that matter, what about `C-x b'? What we do is look the 138 do? For that matter, what about `C-x b'? What we do is look the
147 finally check US ASCII. We ignore the underlying virtual key for 142 finally check US ASCII. We ignore the underlying virtual key for
148 the current layout to avoid the problem of a French speaker 143 the current layout to avoid the problem of a French speaker
149 (AZERTY layout) who temporarily switches to Russian: The virtual 144 (AZERTY layout) who temporarily switches to Russian: The virtual
150 keys underlying Russian are US-ASCII, so what the French speaker 145 keys underlying Russian are US-ASCII, so what the French speaker
151 things of as C-a (the key just to the right of TAB) appears as 146 things of as C-a (the key just to the right of TAB) appears as
152 C-q. (#### We should probably ignore the current char and look 147 C-q.
148
149 I've just implemented this in event-stream.c, and I really want to
150 see feedback from actual Russians about it, and whether it needs to
151 be much more complete than what I've done. E.g, the mapping back to
152 US Qwerty is hardcoded on the X11 side of things, and only deals
153 with the alphabetic characters.
154
155 Also, I think it's downright confusing for people with Roman
156 letters on their keyboard to have random other letters than are
157 described as calling some command, call that command. So I want to
158 consider enabling it by language environment.
159
160 [[ (#### We should probably ignore the current char and look
153 *ONLY* in alt_keychars for all control keys. What about the 161 *ONLY* in alt_keychars for all control keys. What about the
154 English speaker who temporarily switches to the French layout and 162 English speaker who temporarily switches to the French layout and
155 finds C-q mapped to C-a?) */ 163 finds C-q mapped to C-a?) ]]
164
165 No, we shouldn't. People who use the French layout expect that
166 pressing control with the key to the right of tab passes C-a to
167 emacs; English speakers (more exactly, Qwerty users) who
168 temporarily switch to the French layout encounter that issue in
169 every other app too, and they normally remap the keyboard in
170 software as soon as they can, or learn to live with Azerty. That
171 applies for all the Roman-alphabet keyboard layouts. Aidan Kehoe,
172 2005-05-15
173
174 I've taken out the dependency on MULE for this feature because it's
175 also useful in a non-Mule XEmacs where the user has set their font
176 to something ending in iso8859-5. How many of those users there
177 are, is another question. */
156 Ichar alt_keychars[KEYCHAR_LAST]; 178 Ichar alt_keychars[KEYCHAR_LAST];
157 #endif /* MULE */
158 }; 179 };
159 180
160 typedef struct Lisp_Key_Data Lisp_Key_Data; 181 typedef struct Lisp_Key_Data Lisp_Key_Data;
161 182
162 #define KEY_DATA_KEYSYM(d) ((d)->keysym) 183 #define KEY_DATA_KEYSYM(d) ((d)->keysym)
947 Lisp_Object key_sequence_to_event_chain (Lisp_Object seq); 968 Lisp_Object key_sequence_to_event_chain (Lisp_Object seq);
948 /* True if this is a non-internal event 969 /* True if this is a non-internal event
949 (keyboard press, menu, scrollbar, mouse button) */ 970 (keyboard press, menu, scrollbar, mouse button) */
950 int command_event_p (Lisp_Object event); 971 int command_event_p (Lisp_Object event);
951 void define_self_inserting_symbol (Lisp_Object, Lisp_Object); 972 void define_self_inserting_symbol (Lisp_Object, Lisp_Object);
952 Ichar event_to_character (Lisp_Object, int, int, int); 973 Ichar event_to_character (Lisp_Object, int, int);
953 struct console *event_console_or_selected (Lisp_Object event); 974 struct console *event_console_or_selected (Lisp_Object event);
954 void upshift_event (Lisp_Object event); 975 void upshift_event (Lisp_Object event);
955 void downshift_event (Lisp_Object event); 976 void downshift_event (Lisp_Object event);
956 int event_upshifted_p (Lisp_Object event); 977 int event_upshifted_p (Lisp_Object event);
957 978