>># 
>># Copyright 1990, 1991 by the Massachusetts Institute of Technology and
>># UniSoft Group Limited.
>># 
>># Permission to use, copy, modify, distribute, and sell this software and
>># its documentation for any purpose is hereby granted without fee,
>># provided that the above copyright notice appear in all copies and that
>># both that copyright notice and this permission notice appear in
>># supporting documentation, and that the names of MIT and UniSoft not be
>># used in advertising or publicity pertaining to distribution of the
>># software without specific, written prior permission.  MIT and UniSoft
>># make no representations about the suitability of this software for any
>># purpose.  It is provided "as is" without express or implied warranty.
>># 
>># $XConsortium: kyprss.m,v 1.16 92/06/11 17:22:25 rws Exp $
>># 
>>#
>>TITLE KeyPress CH08
>>ASSERTION B KeyPress-1
When any key is pressed, then a KeyPress event is
generated.
>>STRATEGY
If extended testing is required:
  Create window.
  Select for KeyPress events.
  Simulate a KeyPress event on the window.
  Verify that a KeyPress event was delivered.
  Verify that the event member fields are correctly set.
>>ASSERTION B KeyPress-2
When a KeyPress event is generated, then all clients having
set KeyPressMask event mask bits on the event window are
delivered a KeyPress event.
>>STRATEGY
If extended testing is required:
  Create a second client.
  Create a third client.
  Create a window.
  Select for KeyPress events on all clients.
  Simulate a KeyPress event on the window.
  Verify that the event was delivered to all clients.
  Verify that event member fields are correctly set.
Otherwise :
  Create a window.
  Select for KeyPress events.
  Verify no error was generated.
>>ASSERTION B KeyPress-3
When a KeyPress event is generated, then clients not having
set KeyPressMask event mask bits on the event window are not
delivered a KeyPress event.
>>STRATEGY
If extended testing is required:
  Create a window.
  Create a second client.
  Select for various events other than KeyPress for the first client on the window.
  Select for KeyPress events for the second client on the window.
  Simulate a KeyPress event on the window.
  Verify that a KeyPress event was generated for the second client.
  Verify that no events were generated for the first client.
>>ASSERTION B KeyPress-4
When a KeyPress event is generated and no client has
selected KeyPressMask on the source window, then the event
propagates, with propagation stopping at the root window of
the screen or at the first window with KeyPressMask in its
do-not-propagate mask, from the source window to the first
ancestor window for which some client has selected for
KeyPress events.
>>STRATEGY
If extended testing is required:
  Create a window.
  Create a child of that window.
  Create a grandchild of the window.
  Select KeyPress events on the root window of the screen.
  Simulate a KeyPress event on the grandchild.
  Verify that a KeyPress event was generated on the root.
  Select KeyPress events on the grandparent window.
  Set the do_not_propagate mask on the child to KeyPress events.
  Simulate a KeyPress event on the grandchild.
  Verify no KeyPress event was generated on the grandchild.
  Verify no KeyPress event was generated on the child.
  Verify no KeyPress event was generated on the parent.
  Select KeyPress events on the child window.
  Set the do_not_propagate mask of the grandparent to KeyPress events.
  Set the do_not_propagate mask of the child to NoEventMask.
  Simulate a KeyPress event on the grandchild.
  Verify that no KeyPress event was generated on the grandchild.
  Verify that no KeyPress event was generated on the parent.
  Verify that a KeyPress event was generated on the child.
>>ASSERTION B KeyPress-5
When a KeyPress event is delivered and the source window is
an inferior of the event window and the source window is a
child of the event window, then subwindow is set to the
source window.
>>STRATEGY
If extended testing is required:
  Create a window.
  Create a child of the window
  Select KeyPress events on the parent.
  Simulate a KeyPress event on the child.
  Verify that a KeyPress event was generated on the parent.
  Verify that the subwindow component was set to the child.
>>ASSERTION B KeyPress-6
When a KeyPress event is delivered and the source window is
an inferior of the event window and the source window is not
a child of the event window, then subwindow is set to the
child of the event window that is an ancestor of the source
window.
>>STRATEGY
If extended testing is required :
  Create a window.  
  Create a child.
  Create a grandchild.
  Create a great-grandchild.
  Select KeyPress events on the great-grandparent.
  Simulate a KeyPress event on the great-grandchild.
  Verify that a KeyPress event was generated on the great-grandparent.
  Verify that subwindow component of the event was the child.
>>ASSERTION B KeyPress-7
When a KeyPress event is delivered and the source window is
not an inferior of the event window, then subwindow is set
to None.
>>STRATEGY
If extended testing is required:
  Create a window.
  Select KeyPress events on the window.
  Simulate a KeyPress event on the window.
  Verify that a KeyPress event was generated on the window.
  Verify that the subwindow component was set to None.
  Create a second window.
  Grab the keyboard for the first window with owner_events set to False.
  Simulate a KeyPress event on the second window.
  Verify that a KeyPress event was generated on the grabbing window.
  Verify that the subwindow component was set to None.
>>ASSERTION D KeyPress-8
If multiple screens are supported: When a KeyPress event is
delivered and the event and root windows are not on the same
screen, then x and y are set to zero.
>>STRATEGY
If multiple screens are supported:
  If extended testing is required:
    Create a window on the default screen.
    Select KeyPress events on the window.
    Create a window on the alternative screen.
    Grab the keyboard for the first window.
    Simulate a KeyPress event on the alternate window.
    Verify that a KeyPress event was generated on the grabbing window.
    Verify that the x and y components were set to zero.
>>ASSERTION D KeyPress-9
If multiple screens are supported: When a KeyPress event is
delivered and the event and root windows are not on the same
screen, then same_screen is set to False.
>>STRATEGY
If multiple screens are supported:
  If extended testing is required:
    Create a window on the default screen.
    Select KeyPress events on the window.
    Create a window on the alternative screen.
    Grab the keyboard for the first window.
    Simulate a KeyPress event on the alternate window.
    Verify that a KeyPress event was generated on the grabbing window.
    Verify that the same_screen component was False.
