[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

2195.0. "HELP! Key press events, ASTs" by FORTSC::KISHIMURA () Fri Feb 02 1990 19:15

I'm having problems with events, event queue processing, and X$LOOKUP_STRING. 
Can anyone offer me (a novice X user) some advice?  

I put together two tests, but can't seem to get the 2nd one to work properly. 

Test 1 works great, but Test 2 does not...
----------------------------------------------------------------------------

Test 1:     I.  Call X$SELECT_ASYNC_INPUT to specify the name of an AST 
                routine that I want called when events occur.
            II. AST routine:  
                A. Call X$NEXT_EVENT to pull event off queue
                B. If event is a key press, call X$LOOKUP_STRING to translate
                   key event 
     
----------------------------------------------------------------------------

Test 2:     I.  Call X$SELECT_ASYNC_INPUT to specify the name of an AST 
                routine that I want called when events occur.
            II. AST routine:  
                A. Call X$NEXT_EVENT to pull event off queue
                B. Process key press event
                   1.  Call X$LOOKUP_STRING to translate key event
                   2.  If key = CTRL-S, continuously remove key press events
                       from the queue until CTRL-Q is encountered. Repeat 
                       following steps until CTRL-Q found:
                       a.  Call X$MASK_EVENT to get key press event
                       b.  Call X$LOOKUP_STRING to translate key event

Results:  - Step II.A properly removes event from queue 
          - Step II.B.1 properly translates key event into an ASCII string
          - Step II.B.2.a is properly called if key event was CTRL-S
    *****>- Step II.B.2.b doesn't always work right
            - X$LOOKUP_STRING seems to work okay until a CTRL key is pressed
            - X$LOOKUP_STRING returns 0 (string length), does not update
              my buffer, yet it properly updates keysym_id_return
            - ASTs also seem to get backed up causing process to exceed 
              AST limit (client hangs and is eventually dropped by server).

Am I doing something really stuipd here?  Any advice you may offer will be 
greatly appreciated.  Thanks!
---------------------------------------------------------------------------
T.RTitleUserPersonal
Name
DateLines
2195.1I think there's a bug in X$LOOKUP_STRINGLENO::GRIERmjg's holistic computing agencyWed Feb 14 1990 14:229
   I had a similar problem trying to use the VMS binding to XLookupString.
I didn't have time to figure out if it was my problem at the time, or if it
was QAR material.

   Have you gotten it to work yet?  Could you QAR it?  I don't have the time
now to write up example code which doesn't work so I can QAR it.


					-mjg
2195.2Keysyms are not all ISO8859FEGPX::SWEENEYPatrick Sweeney in Hong KongTue Feb 20 1990 10:0116
    Regarding X$LOOKUP_STRING, since there really wasn't a clear
    explanation of the problem in .0, and since .1 implies there's an error
    in the binding, let me offer a statement of the problem:
    
    "XLookupString (X$LOOKUP_STRING) takes as input an event, correctly
    returns the keysym, but doesn't update the buffer, and returns a byte
    count of 0."
    
    My answer (and please recall that I'm only a field person without the
    authority of a DECwindows engineer)
    
    "Every keysym _doesn't_ translation into a character (or characters) of
    the ISO 8859 character set, so for those keysyms (like PF1,F11,etc)
    the returned bytes is 0 and the buffer is not updated."
    
    I consider this to be a documentation error by omission.
2195.3No, I mean a real error...LENO::GRIERmjg's holistic computing agencyTue Feb 20 1990 23:4013
  It was during my minimal port of the VWS SmallTalk to DECwindows - I wanted
to just translate the keypressed events into ASCII.  I was unable to get
X$LOOKUP_STRING to work AT ALL with several hours of fooling around, but
when I switched to using the XLookupString MIT/C binding (still from Pascal)
it worked.

   I wasn't trying to spend much time on it, and I have to admit, I sleazed out
and didn't QAR it/make a reproducible minimal program.  I was never really
sure if I was still calling it incorrectly or if the VAX binding wasn't
working right.

					-mjg