aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1994-11-01 08:49:40 +0000
committerRichard M. Stallman1994-11-01 08:49:40 +0000
commitbc536d847736f466727453ca6aa7c07aef6fce46 (patch)
tree4a91e841b1f776718f23c2013627f0a267fcc125
parent881a5a809352cf0f848255cb96dce37ad7d0223b (diff)
downloademacs-bc536d847736f466727453ca6aa7c07aef6fce46.tar.gz
emacs-bc536d847736f466727453ca6aa7c07aef6fce46.zip
(read_key_sequence): Use flags instead of gotos to
enable the Microsoft C compiler to compile the routine. (read_avail_input) [WINDOWSNT]: Just return 0. (make_lispy_event): Record double and triple for drags. Put in click_modifier for multi-clicks. (read_key_sequence): Convert double-drag first to plan drag, and only later try a click.
-rw-r--r--src/keyboard.c43
1 files changed, 29 insertions, 14 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index b82e4e3dc0e..cef26d86ab2 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -2877,18 +2877,19 @@ make_lispy_event (event)
2877 if (EQ (event->x, XCONS (down)->car) 2877 if (EQ (event->x, XCONS (down)->car)
2878 && EQ (event->y, XCONS (down)->cdr)) 2878 && EQ (event->y, XCONS (down)->cdr))
2879 { 2879 {
2880 if (is_double && double_click_count > 1) 2880 event->modifiers |= click_modifier;
2881 event->modifiers |= ((double_click_count > 2)
2882 ? triple_modifier
2883 : double_modifier);
2884 else
2885 event->modifiers |= click_modifier;
2886 } 2881 }
2887 else 2882 else
2888 { 2883 {
2889 button_down_time = 0; 2884 button_down_time = 0;
2890 event->modifiers |= drag_modifier; 2885 event->modifiers |= drag_modifier;
2891 } 2886 }
2887 /* Don't check is_double; treat this as multiple
2888 if the down-event was multiple. */
2889 if (double_click_count > 1)
2890 event->modifiers |= ((double_click_count > 2)
2891 ? triple_modifier
2892 : double_modifier);
2892 } 2893 }
2893 } 2894 }
2894 else 2895 else
@@ -3591,6 +3592,9 @@ read_avail_input (expected)
3591 int n_to_read; 3592 int n_to_read;
3592 3593
3593 /* Determine how many characters we should *try* to read. */ 3594 /* Determine how many characters we should *try* to read. */
3595#ifdef WINDOWSNT
3596 return 0;
3597#else /* not WINDOWSNT */
3594#ifdef MSDOS 3598#ifdef MSDOS
3595 n_to_read = dos_keysns (); 3599 n_to_read = dos_keysns ();
3596 if (n_to_read == 0) 3600 if (n_to_read == 0)
@@ -3620,6 +3624,7 @@ read_avail_input (expected)
3620#endif 3624#endif
3621#endif 3625#endif
3622#endif /* not MSDOS */ 3626#endif /* not MSDOS */
3627#endif /* not WINDOWSNT */
3623 3628
3624 /* Now read; for one reason or another, this will not block. 3629 /* Now read; for one reason or another, this will not block.
3625 NREAD is set to the number of chars read. */ 3630 NREAD is set to the number of chars read. */
@@ -4518,6 +4523,9 @@ read_key_sequence (keybuf, bufsize, prompt)
4518 Lisp_Object first_event; 4523 Lisp_Object first_event;
4519#endif 4524#endif
4520 4525
4526 /* Gets around Microsoft compiler limitations. */
4527 int dummyFlag = 0;
4528
4521 struct buffer *starting_buffer; 4529 struct buffer *starting_buffer;
4522 4530
4523 /* Nonzero if we seem to have got the beginning of a binding 4531 /* Nonzero if we seem to have got the beginning of a binding
@@ -4710,7 +4718,10 @@ read_key_sequence (keybuf, bufsize, prompt)
4710 if (INTEGERP (key) && XINT (key) == -1) 4718 if (INTEGERP (key) && XINT (key) == -1)
4711 { 4719 {
4712 t = 0; 4720 t = 0;
4713 goto done; 4721 /* The Microsoft C compiler can't handle the goto that
4722 would go here. */
4723 dummyFlag = 1;
4724 break;
4714 } 4725 }
4715 4726
4716 /* If the current buffer has been changed from under us, the 4727 /* If the current buffer has been changed from under us, the
@@ -4887,7 +4898,9 @@ read_key_sequence (keybuf, bufsize, prompt)
4887 read_key_sequence_cmd = Vprefix_help_command; 4898 read_key_sequence_cmd = Vprefix_help_command;
4888 keybuf[t++] = key; 4899 keybuf[t++] = key;
4889 last_nonmenu_event = key; 4900 last_nonmenu_event = key;
4890 goto done; 4901 /* The Microsoft C compiler can't handle the goto that
4902 would go here. */
4903 dummyFlag = 1;
4891 } 4904 }
4892 4905
4893 if (SYMBOLP (head)) 4906 if (SYMBOLP (head))
@@ -4915,8 +4928,10 @@ read_key_sequence (keybuf, bufsize, prompt)
4915 Lisp_Object new_head, new_click; 4928 Lisp_Object new_head, new_click;
4916 if (modifiers & triple_modifier) 4929 if (modifiers & triple_modifier)
4917 modifiers ^= (double_modifier | triple_modifier); 4930 modifiers ^= (double_modifier | triple_modifier);
4918 else if (modifiers & (drag_modifier | double_modifier)) 4931 else if (modifiers & double_modifier)
4919 modifiers &= ~(drag_modifier | double_modifier); 4932 modifiers &= ~double_modifier;
4933 else if (modifiers & drag_modifier)
4934 modifiers &= ~drag_modifier;
4920 else 4935 else
4921 { 4936 {
4922 /* Dispose of this `down' event by simply jumping 4937 /* Dispose of this `down' event by simply jumping
@@ -5238,11 +5253,11 @@ read_key_sequence (keybuf, bufsize, prompt)
5238 } 5253 }
5239 } 5254 }
5240 5255
5241 read_key_sequence_cmd = (first_binding < nmaps 5256 if (!dummyFlag)
5242 ? defs[first_binding] 5257 read_key_sequence_cmd = (first_binding < nmaps
5243 : Qnil); 5258 ? defs[first_binding]
5259 : Qnil);
5244 5260
5245 done:
5246 unread_switch_frame = delayed_switch_frame; 5261 unread_switch_frame = delayed_switch_frame;
5247 unbind_to (count, Qnil); 5262 unbind_to (count, Qnil);
5248 5263