/* Control gratuitous keyboard focus throwing. */
int focus_follows_mouse;
+int modifier_keys_are_sticky;
+
#if 0 /* FSF Emacs crap */
/* Hook run after a command if there's no more input soon. */
Lisp_Object Qpost_command_idle_hook, Vpost_command_idle_hook;
event_stream->quit_p_cb ();
}
+static int
+event_stream_current_event_timestamp (struct console *c)
+{
+ if (event_stream && event_stream->current_event_timestamp_cb)
+ return event_stream->current_event_timestamp_cb (c);
+ else
+ return 0;
+}
\f
/**********************************************************************/
XEVENT (event)->event.key.keysym = traduit;
did_translate = 1;
}
+ else if (CHARP (traduit))
+ {
+ Lisp_Event ev2;
+
+ zero_event (&ev2);
+ character_to_event (XCHAR (traduit), &ev2,
+ XCONSOLE (EVENT_CHANNEL (XEVENT (event))), 1, 1);
+ XEVENT (event)->event.key.keysym = ev2.event.key.keysym;
+ XEVENT (event)->event.key.modifiers |= ev2.event.key.modifiers;
+ did_translate = 1;
+ }
}
#ifdef DEBUG_XEMACS
-- any events in `unread-command-events' or `unread-command-event'; else
-- the next event in the currently executing keyboard macro, if any; else
--- an event queued by `enqueue-eval-event', if any; else
+-- an event queued by `enqueue-eval-event', if any, or any similar event
+ queued internally, such as a misc-user event. (For example, when an item
+ is selected from a menu or from a `question'-type dialog box, the item's
+ callback is not immediately executed, but instead a misc-user event
+ is generated and placed onto this queue; when it is dispatched, the
+ callback is executed.) Else
-- the next available event from the window system or terminal driver.
In the last case, this function will block until an event is available.
widgets. Normally these are redisplayed through a native window-system
event encoded as magic event, rather than by the redisplay code. This
function does not call redisplay or do any of the other things that
-`next-event' does.
+`next-event' does.
*/
())
{
return result;
}
-/* This handy little function is used by xselect.c and energize.c to
- wait for replies from processes that aren't really processes (that is,
- the X server and the Energize server).
- */
+/* This handy little function is used by select-x.c to wait for replies
+ from processes that aren't really processes (e.g. the X server) */
void
wait_delaying_user_input (int (*predicate) (void *arg), void *predicate_arg)
{
soon as a command other than self-insert-command is executed.
Programmers can also use the `self-insert-defer-undo'
- property to install that behaviour on functions other
+ property to install that behavior on functions other
than `self-insert-command', or to change the magic
number 20 to something else. #### DOCUMENT THIS! */
}
\f
+
+DEFUN ("current-event-timestamp", Fcurrent_event_timestamp, 0, 1, 0, /*
+Return the current event timestamp of the window system associated with CONSOLE.
+CONSOLE defaults to the selected console if omitted.
+*/
+ (console))
+{
+ struct console *c = decode_console (console);
+ int tiempo = event_stream_current_event_timestamp (c);
+
+ /* This junk is so that timestamps don't get to be negative, but contain
+ as many bits as this particular emacs will allow.
+ */
+ return make_int (((1L << (VALBITS - 1)) - 1) & tiempo);
+}
+
+\f
/************************************************************************/
/* initialization */
/************************************************************************/
defsymbol (&Qdisabled, "disabled");
defsymbol (&Qcommand_event_p, "command-event-p");
- deferror (&Qundefined_keystroke_sequence, "undefined-keystroke-sequence",
- "Undefined keystroke sequence", Qerror);
+ DEFERROR_STANDARD (Qundefined_keystroke_sequence, Qinvalid_argument);
DEFSUBR (Frecent_keys);
DEFSUBR (Frecent_keys_ring_size);
DEFSUBR (Fthis_command_keys);
DEFSUBR (Freset_this_command_lengths);
DEFSUBR (Fopen_dribble_file);
+ DEFSUBR (Fcurrent_event_timestamp);
defsymbol (&Qpre_command_hook, "pre-command-hook");
defsymbol (&Qpost_command_hook, "post-command-hook");
This occurs whenever it is going to block, waiting for an event.
This generally happens as a result of a call to `next-event',
`next-command-event', `sit-for', `sleep-for', `accept-process-output',
-`x-get-selection', or various Energize-specific commands.
+or `x-get-selection'.
Errors running the hook are caught and ignored.
*/ );
Vpre_idle_hook = Qnil;
keysym changed and its modifiers left alone. This is useful for
dealing with non-standard X keyboards, such as the grievous damage
that Sun has inflicted upon the world.
+-- If an entry maps a symbol to a character, then a key-press event
+ whose keysym is the former symbol (with any modifiers at all) gets
+ changed into a key-press event matching the latter character, and the
+ resulting modifiers are the union of the original and new modifiers.
-- If an entry maps a character to a character, then a key-press event
matching the former character gets converted to a key-press event
matching the latter character. This is useful on ASCII terminals
-- If an entry maps a character to a symbol, then a key-press event
matching the character gets converted to a key-press event whose
keysym is the given symbol and which has no modifiers.
+
+Here's an example: This makes typing parens and braces easier by rerouting
+their positions to eliminate the need to use the Shift key.
+
+ (keyboard-translate ?[ ?()
+ (keyboard-translate ?] ?))
+ (keyboard-translate ?{ ?[)
+ (keyboard-translate ?} ?])
+ (keyboard-translate 'f11 ?{)
+ (keyboard-translate 'f12 ?})
*/ );
DEFVAR_LISP ("retry-undefined-key-binding-unshifted",
*/ );
Vretry_undefined_key_binding_unshifted = Qt;
+ DEFVAR_BOOL ("modifier-keys-are-sticky", &modifier_keys_are_sticky /*
+*Non-nil makes modifier keys sticky.
+This means that you can release the modifier key before pressing down
+the key that you wish to be modified. Although this is non-standard
+behavior, it is recommended because it reduces the strain on your hand,
+thus reducing the incidence of the dreaded Emacs-pinky syndrome.
+*/ );
+ modifier_keys_are_sticky = 0;
+
#ifdef HAVE_XIM
DEFVAR_LISP ("composed-character-default-binding",
&Vcomposed_character_default_binding /*