i.e. line or page up or down. WIDGET is the Xaw scroll bar
widget. CLIENT_DATA is a pointer to the scroll_bar structure for
the scroll bar. CALL_DATA is an integer specifying the action that
- has taken place. It's magnitude is in the range 0..height of the
+ has taken place. Its magnitude is in the range 0..height of the
scroll bar. Negative values mean scroll towards buffer start.
Values < height of scroll bar mean line-wise movement. */
XtPointer client_data, call_data;
{
struct scroll_bar *bar = (struct scroll_bar *) client_data;
- int position = (int) call_data;
+ /* Fixme: Check this. */
+ long position = (long) call_data;
Dimension height;
int part;
if (temp_index == sizeof temp_buffer / sizeof (short))
temp_index = 0;
temp_buffer[temp_index++] = keysym;
- if (! EQ ((c = Fgethash (make_number (keysym),
- Vx_keysym_table, Qnil)),
+ /* First deal with keysyms which have
+ defined translations to characters. */
+ if (keysym > 0 && keysym < 128)
+ /* Fixme: Is this always right? It avoids
+ explicitly decoding each ASCII character. */
+ {
+ bufp->kind = ascii_keystroke;
+ bufp->code = c;
+ }
+ else if (! EQ ((c = Fgethash (make_number (keysym),
+ Vx_keysym_table,
+ Qnil)),
Qnil))
{
bufp->kind = (ASCII_CHAR_P (c)
bufp->code = c;
}
else
+ /* Not a character keysym.
+ make_lispy_event will convert it to a
+ symbolic key. */
{
bufp->kind = non_ascii_keystroke;
bufp->code = keysym;
numchars--;
}
else if (numchars > nbytes)
- {
+ { /* Raw characters, not keysym. */
register int i;
register int c;
int nchars, len;
temp_buffer[temp_index++] = copy_bufptr[i];
}
- {
- /* Decode the input data. */
- coding.destination
- = (unsigned char *) malloc (nbytes);
- if (! coding.destination)
- break;
- coding.dst_bytes = nbytes;
- coding.mode |= CODING_MODE_LAST_BLOCK;
- decode_coding_c_string (&coding, copy_bufptr,
- nbytes, Qnil);
- nbytes = coding.produced;
- nchars = coding.produced_char;
- if (copy_bufsiz < nbytes)
- {
- copy_bufsiz = nbytes;
- copy_bufptr = (char *) alloca (nbytes);
- }
- bcopy (coding.destination, copy_bufptr, nbytes);
- free (coding.destination);
- }
+ {
+ /* Decode the input data. */
+ coding.destination
+ = (unsigned char *) malloc (nbytes);
+ if (! coding.destination)
+ break;
+ coding.dst_bytes = nbytes;
+ coding.mode |= CODING_MODE_LAST_BLOCK;
+ decode_coding_c_string (&coding, copy_bufptr,
+ nbytes, Qnil);
+ nbytes = coding.produced;
+ nchars = coding.produced_char;
+ if (copy_bufsiz < nbytes)
+ {
+ copy_bufsiz = nbytes;
+ copy_bufptr = (char *) alloca (nbytes);
+ }
+ bcopy (coding.destination, copy_bufptr, nbytes);
+ free (coding.destination);
+ }
/* Convert the input data to a sequence of
character events. */
DEFVAR_LISP ("x-keysym-table", &Vx_keysym_table,
doc: /* Hash table of character codes indexed by X keysym codes. */);
- Vx_keysym_table = make_hash_table (Qeql, make_number (800),
- make_number (DEFAULT_REHASH_SIZE),
- make_number (DEFAULT_REHASH_THRESHOLD),
+ Vx_keysym_table = make_hash_table (Qeql, make_number (900),
+ make_float (DEFAULT_REHASH_SIZE),
+ make_float (DEFAULT_REHASH_THRESHOLD),
Qnil, Qnil, Qnil);
}