[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

1412.0. "<SHIFT> key" by MINDER::ADRIAN () Mon Sep 11 1989 13:47

    This may seem like a bit of a silly question but is it possible
    under DECWINDOWS to detect if the <SHIFT> key is currently being
    held down. I would imagine that regardless of the configuration
    (ie DECwindows/VWS/workstation/dumb terminal) it is not possible
    due to the fact that pressing <SHIFT> is strictly a keyboard local
    affair. The only other way that it may be possible is that if there 
    is some escape sequence which could be sent to the terminal to force 
    the terminal to reply with some sort of bit mapping indicating which 
    keys are currently being held down.
    
    Any help appreciated.
    
    A.S.

T.RTitleUserPersonal
Name
DateLines
1412.1It can be doneSX4GTO::ROSEMon Sep 11 1989 14:332
    Have you looked at XQueryKeymap()?

1412.2MU::PORTERwhy?Mon Sep 11 1989 16:1117
The question suggests a confusion about keyboards.

The keyboard itself sends codes which tells whatever-it's-connected-to
about key up/down motions.  In this respect, "shift" is just
another key.

Whether your program can find this out, though, is another
matter.  If your program thinks it's talking to a terminal (whether
or not it's a real terminal like a VT220 or a synthetic
terminal like a DECterm), then no it can't -- because "shift"
is local to the terminal.

If your program is dealing with the keyboard through some
other mechanism, then it may have a better chance.  For
example, if it's using Xlib or Xtoolkit routines, then it
can find out about all key movements.

1412.3DECWIN::FISHERBurns Fisher 381-1466, ZKO3-4/W23Mon Sep 11 1989 18:446
Be careful about shift lock in making general statemens like .2.  Shift lock
is a special case.  I'm not sure you can find out about that one.  You can
find out about shift, though.

Burns

1412.4DECWIN::FISHERBurns Fisher 381-1466, ZKO3-4/W23Mon Sep 11 1989 18:455
In fact, you can probably even find out if the left or right shift key is
down!

Burns

1412.5KONING::KONINGNI1D @FN42eqMon Sep 11 1989 19:479
Nope, they are the same keycode in the LK201.  The shift-lock key is a
completely separate key with its own keycode, so at that level Dave's comment
is valid.  In other words, so long as X or Xt don't hide things, you can tell
a shift from a shiftlock.

(Come to think of it, it isn't a shiftlock usually, it's capslock.)

	paul

1412.6Shift lock is special cased in the low level s/w last I knewDECWIN::FISHERBurns Fisher 381-1466, ZKO3-4/W23Tue Sep 12 1989 11:129
Well, I was not sure about the left and right on a 201.  X has separate
keysyms for them.  However, while shiftlock is separate on the kb, I believe
that the driver or the server mashes it around and simulates holding the
shift key down.
This is because the X folks, until recently, had not figured out how to get
this to work right.

Burns

1412.7STAR::MCLEMANJeff McLeman, VMS DevelopmentTue Sep 12 1989 12:462
You cannot differentiate between left and right shifts on the LK201.

1412.8There is another...IO::MCCARTNEYJames T. McCartney III - DTN 381-2244 ZK02-2/N24Sun Sep 17 1989 07:247
    However, do  not assume that you won't ever be able to detect both left
    and right shifts.   The successor to the LK201 does allow both left and
    right shift (and alts) to be detected.
    
    James