[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bulova::decw_jan-89_to_nov-90

Title:DECWINDOWS 26-JAN-89 to 29-NOV-90
Notice:See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit
Moderator:STAR::VATNE
Created:Mon Oct 30 1989
Last Modified:Mon Dec 31 1990
Last Successful Update:Fri Jun 06 1997
Number of topics:3726
Total number of notes:19516

1289.0. "What Events Should the ALT Key Generate?" by CSC32::K_OGLESBY () Wed Aug 16 1989 14:17

There are plenty of descriptions in this conference of the new "ALT" where
the Compose Character key used to be and the corresponding change in
behavior.  However, I can find no documentation on the expected behavior of
the ALT key as a modifier key.  

My basic question is this:  should the ALT key be expected to appear in the
keypress event mask along with the Control, Shift and Help keys when
combinations of those keys are used together?  To put it another way, when
you press Ctrl/Shift/PF1 you would expect to see all three keys in the
resultant mask.  If you press Ctrl/Shift/Alt/PF1 shouldn't you expect to see
all four keys in the mask?

A small program that generated the following keypress events will be in the
next reply just in case this is programming error rather than misunderstanding
or bug.  Presses and releases are recorded, and strangely (to me) any
sequence of more than 2 modifier keys that includes the ALT, loses the ALT
and anything that follows it.  Can someone explain this please, and offer a
brief description of what the Modn masks do or offer a pointer to TFM?

The first line of each block is the key that is pushed and all lines that
follow are the events that come back describing whether it was a Press or 
Release and which bits were set:

Push: Control/Shift/Help           
Press   Control_L
Press   Shift_L Control		All 3 keys as expected
Press   Help Shift Control
Release Help Shift Control Mod5
Release Shift_L Shift Control
Release Control_L Control

Push: Control/Shift/Help/PF1
Press   Control_L
Press   Shift_L Control
Press   Help Shift Control
Press   KP_F1 Shift Control Mod5	All 4 as expected
Release KP_F1 Shift Control Mod5
Release Help Shift Control Mod5
Release Shift_L Shift Control
Release Control_L Control

Push: Control/Shift/Alt
Press   Control_L
Press   Shift_L Control			Where did ALT go?
Release Shift_L Shift Control
Release Control_L Control

Push: Control/Help/Alt
Press   Control_L
Press   Help Control			Where is ALT and is Mod5 a clue?
Release Help Control Mod5
Release Control_L Control

Push: Control/Help/Alt/PF1
Press   Control_L
Press   Help Control			No ALT or PF1
Release Help Control Mod5
Release Control_L Control

Push: Control/Alt
Press   Control_L
Press   Alt_L Control			As expected
Release Alt_L Control Mod1
Release Control_L Control

Push: Shift/Alt
Press   Shift_L
Press   Alt_L Shift			As expected
Release Alt_L Shift Mod1
Release Shift_L Shift

Push: Control/Shift/Alt but release Shift while holding Control/Alt
Press   Control_L
Press   Shift_L Control
Release Shift_L Shift Control		As soon as Shift is released
Press   Alt_L Control			ALT is seen, but no other event
Release Alt_L Control Mod1		comes through while ALT is held
Release Control_L Control		with Control

Push: Control/Shift/Alt
Press   Control_L
Press   Shift_L Control			Press ALT all day long but
Release Control_L Shift Control		never get an event
Release Shift_L Shift

T.RTitleUserPersonal
Name
DateLines
1289.1The Code that Returned the EventsCSC32::K_OGLESBYWed Aug 16 1989 14:2062
#include stdio
#include "decw$include:xlib.h"


void Print( dpy, what, key, mask )
	Display *dpy;
	char	*what;
	int	key;
	int 	mask;
{
	fprintf( stderr, "%s\011%s", what, 
		XKeysymToString(XKeycodeToKeysym(dpy, key, 0)) );

	if (mask & ShiftMask) fprintf(stderr, " Shift");
	if (mask & LockMask) fprintf(stderr, " Lock");
	if (mask & ControlMask) fprintf(stderr, " Control");
	if (mask & Mod1Mask) fprintf(stderr, " Mod1");
	if (mask & Mod2Mask) fprintf(stderr, " Mod2");
	if (mask & Mod3Mask) fprintf(stderr, " Mod3");
	if (mask & Mod4Mask) fprintf(stderr, " Mod4");
	if (mask & Mod5Mask) fprintf(stderr, " Mod5");
	fprintf(stderr, "\n");
}

void HandlePress( dpy, event )
	Display *dpy;
	XKeyPressedEvent *event;
{
	Print( dpy, "Press", event->keycode, event->state );
}


void HandleRelease( dpy, event )
	Display *dpy;
	XKeyPressedEvent *event;
{
	Print( dpy, "Release", event->keycode, event->state );
}



main()
{
	Display	*dpy;
	Window	*win;
	int 	i;

	dpy = XOpenDisplay( NULL );
	win = XCreateWindow( dpy, XDefaultRootWindow( dpy ), 
		0, 0, 200, 200, 1, 0, 0 );
	XMapWindow( dpy, win );
	XSelectInput( dpy, win, KeyPressMask | KeyReleaseMask );

	for ( ;; ) {
		XEvent	event;
		XNextEvent( dpy, &event );
		if ( event.type == KeyPress) HandlePress( dpy, &event );
		else if (event.type == KeyRelease) HandleRelease( dpy, &event );
		else fprintf( stderr, "event type = %d\n", event.type);
	}
}

1289.2LK201 keyboard limitationDECWIN::HUGHEYFri Aug 18 1989 12:1312
    The LK201 keyboard hardware has a limitiation which explains at least
    part of what you are seeing.  Because of the way that the keys on the
    keyboard are partitioned, the keyboard hardware will not transmit the
    third key pressed when the SHIFT, CTRL, and ALT keys are depressed.
    When one of the first two keys is released, then the third will be
    transmitted.
    
    (The LK201 hardware group is aware of this problem, and it will be
    corrected in future keyboard hardware.)
    
    Teresa