Mercurial > hg > xemacs-beta
comparison src/events.c @ 288:e11d67e05968 r21-0b42
Import from CVS: tag r21-0b42
author | cvs |
---|---|
date | Mon, 13 Aug 2007 10:35:54 +0200 |
parents | 558f606b08ae |
children | 8626e4521993 |
comparison
equal
deleted
inserted
replaced
287:13a0bd77a29d | 288:e11d67e05968 |
---|---|
382 | 382 |
383 DEFUN ("make-event", Fmake_event, 0, 2, 0, /* | 383 DEFUN ("make-event", Fmake_event, 0, 2, 0, /* |
384 Return a new event of type TYPE, with properties described by PLIST. | 384 Return a new event of type TYPE, with properties described by PLIST. |
385 | 385 |
386 TYPE is a symbol, either `empty', `key-press', `button-press', | 386 TYPE is a symbol, either `empty', `key-press', `button-press', |
387 `button-release', or `motion'. If TYPE is nil, it | 387 `button-release', `misc-user' or `motion'. If TYPE is nil, it |
388 defaults to `empty'. | 388 defaults to `empty'. |
389 | 389 |
390 PLIST is a property list, the properties being compatible to those | 390 PLIST is a property list, the properties being compatible to those |
391 returned by `event-properties'. The following properties are | 391 returned by `event-properties'. The following properties are |
392 allowed: | 392 allowed: |
393 | 393 |
394 channel -- The event channel, a frame or a console. For | 394 channel -- The event channel, a frame or a console. For |
395 button-press, button-release, motion events, | 395 button-press, button-release, misc-user and motion events, |
396 this must be a frame. For key-press | 396 this must be a frame. For key-press events, it must be |
397 events, it must be a console. If channel is | 397 a console. If channel is unspecified, it will be set to |
398 unspecified, it will be set to the selected frame | 398 the selected frame or selected console, as appropriate. |
399 or selected console, as appropriate. | |
400 key -- The event key, a symbol or character. Allowed only for | 399 key -- The event key, a symbol or character. Allowed only for |
401 keypress events. | 400 keypress events. |
402 button -- The event button, integer 1, 2 or 3. Allowed for | 401 button -- The event button, integer 1, 2 or 3. Allowed for |
403 button-press, button-release and misc-user events. | 402 button-press, button-release and misc-user events. |
404 modifiers -- The event modifiers, a list of modifier symbols. Allowed | 403 modifiers -- The event modifiers, a list of modifier symbols. Allowed |
405 for key-press, button-press, button-release, motion and | 404 for key-press, button-press, button-release, motion and |
406 misc-user events. | 405 misc-user events. |
406 function -- Function. Allowed for misc-user events only. | |
407 object -- An object, function's parameter. Allowed for misc-user | |
408 events only. | |
407 x -- The event X coordinate, an integer. This is relative | 409 x -- The event X coordinate, an integer. This is relative |
408 to the left of CHANNEL's root window. Allowed for | 410 to the left of CHANNEL's root window. Allowed for |
409 motion, button-press, button-release and misc-user events. | 411 motion, button-press, button-release and misc-user events. |
410 y -- The event Y coordinate, an integer. This is relative | 412 y -- The event Y coordinate, an integer. This is relative |
411 to the top of CHANNEL's root window. Allowed for | 413 to the top of CHANNEL's root window. Allowed for |
499 if (e->event_type == key_press_event) | 501 if (e->event_type == key_press_event) |
500 { | 502 { |
501 if (!CONSOLEP (value)) | 503 if (!CONSOLEP (value)) |
502 value = wrong_type_argument (Qconsolep, value); | 504 value = wrong_type_argument (Qconsolep, value); |
503 } | 505 } |
504 else if (e->event_type != misc_user_event) | 506 else |
505 { | 507 { |
506 if (!FRAMEP (value)) | 508 if (!FRAMEP (value)) |
507 value = wrong_type_argument (Qframep, value); | 509 value = wrong_type_argument (Qframep, value); |
508 } | 510 } |
509 EVENT_CHANNEL (e) = value; | 511 EVENT_CHANNEL (e) = value; |
669 error ("Undefined button for %s event", | 671 error ("Undefined button for %s event", |
670 e->event_type == button_press_event | 672 e->event_type == button_press_event |
671 ? "buton-press" : "button-release"); | 673 ? "buton-press" : "button-release"); |
672 break; | 674 break; |
673 case misc_user_event: | 675 case misc_user_event: |
674 if (!e->event.misc.button) | 676 if (NILP (e->event.misc.function)) |
675 error ("Undefined button for misc-user event"); | 677 error ("Undefined function for misc-user event"); |
676 break; | 678 break; |
677 default: | 679 default: |
678 break; | 680 break; |
679 } | 681 } |
680 | 682 |