[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

2036.0. "Keycode values table" by TOWNS::RUFFIEUX () Sun Jan 14 1990 12:52

    Does anybody know where I can find documentation that contains 
    a table of keyboard keys and ther cooresponding Keycode values?
    To be more clear, in the data structure XKeyEvent, there is a
    member named keycode which is defined as "An arbitrary but unique
    representation of the key that generated the event".  I would like
    to know where the table is or I need to know the Keycode value
    for the Return key.
    
    
    Thank you for any help in advance.
    
    Chris
T.RTitleUserPersonal
Name
DateLines
2036.1CRLTRX::jgJim Gettys, Cambridge Research LabSun Jan 14 1990 15:019
You may be trying to do something evil.....

In any case, for DEC keyboards, the keycode happens to be the LK201 scan-code.
So you can get a list from the LK201 spec.

Note that making things keycode dependent is almost always the wrong thing to
do, as your software may not run against other people's servers, or future
DEC keyboards.
				- Jim
2036.2Lemme second that...(KeySym's are the way to go)GOLLY::MILLERI need 'Deeper Understanding'Sun Jan 14 1990 18:1416
If we'd only used KeySym's from the beginning, we'd have a lot less 
re-work to do.

Our application's a server extension, and we had access to server header
files.  Because it seemed *easy to do* at first, we went with KeyCodes in
our scripting.

Now we've got a nightmarish UI with respect to modifying KeyCode
related info. and we're also inadvertantly locked into the LK201.

We're remedying this shortly.

Regards,

                      == ken miller ==
                      DEC/Test Manager Development
2036.3an easier way???TOWNS::RUFFIEUXSun Jan 14 1990 22:2710
    The reason I needed the key code is to do the following: ( Maybe there
    is an easier way to do it??)
    
    	I have a simple text widget.  When the user enters text into the
    	widget and is done, I would like for them to be able to press
    	<RETURN> and activate a callback.  I was going to do this by
    	monitoring the keycode for a <RETURN> in a value_changed callback.
        Once the <RETURN> was sensed, I would capture the data in the
        stext.  If anyone knows an easier way, please let me know..
    
2036.4Default buttonFEGPX::SWEENEYPatrick Sweeney in Hong KongMon Jan 15 1990 09:527
    There's a simple way.  Don't know why it isn't emphasized in learning
    DECwindows:
    
    For the popup dialog box there's a default button resource. When you
    assign an "OK" pushbutton to the value for default button, you will get
    an activate callback when the user types return.  Alternatively, the
    user call press MB1 on the pushbutton and get the same semantics.
2036.5thanksTOWNS::RUFFIEUXMon Jan 15 1990 12:473
    re.4
    
    	Thanks alot...
2036.6Just for completenessDECWIN::FISHERBurns Fisher 381-1466, ZKO3-4/W23Mon Jan 15 1990 21:419
    Of course, if you wanted to find the keycodes, you could do what Xlib
    does:  Use XGetKeyboardMapping.  That gives you the mapping between
    keycodes (the "arbitrary numbers") and keysyms, a different set of
    numbers defined by the X protocol, which indicates the symbol that is
    on the keytop.
    
    Burns