Loading ...
Sorry, an error occurred while loading the content.

1824Re: [jasspa] Accented vowels

Expand Messages
  • Jon Green
    Apr 10, 2006
      OK after digging into this a bit more then it is the compose that is
      causing a problem. I'm running on Sun and just switched into French, so
      on the Sun keyboard there is a special compose key (not sure what Linux
      does?) so I receive a XK_Multi_key event (xff20) which generates a
      space, then I can enter i' or 'i and get the appropriate accent.

      Tracing the input and using the compose status in the
      XLookupString(&event.xkey,keyStr,20,&keySym,&comp) I get:

      #1 got key ff20, ss=0 comp=0
      Adding ff key to buffer 32(0x0020)
      #1 got key ff20, ss=0 comp=1
      Adding ff key to buffer 32(0x0020)
      #1 got key 69, ss=0 comp=2
      Adding 00 key to buffer 105(0x0069)
      #1 got key ec, ss=0 comp=3
      Adding 00 key to buffer 236(0x00ec)

      So the compose does eventually produce the correct character and comp=0
      when we drop out of compose mode. Digging around the web I found the
      following which is probably what we need to add to process the strings.
      I'll have another play around with this tomorrow night.



      Some international lang conversion code example:

      case KeyPress:
      Keysym keysym;
      Status status;
      int buflength;
      static int bufsize = 16;
      static char *buf = NULL;
      if (buf == NULL) {
      buf = malloc(bufsize);
      if (buf < 0) StopSequence();
      buflength = XmbLookupString(ic, &event, buf, bufsize,
      &keysym, &status);
      /* first, check to see if that worked */
      if (status == XBufferOverflow) {
      buf = realloc(buf, (bufsize = buflength));
      buflength = XmbLookupString(ic, &event, buf, bufsize,
      &keysym, &status);
      /* We have a valid status. Check that */
      switch(status) {
      case XLookupKeysym:
      case XLookupBoth:
      /* **FALL INTO** charcter case */
      case XLookupChars:
      DealWithString(buf, buflength);
      case XLookupNone:
      } /* end switch(status) */
      } /* end case KeyPress segment */
      break; /* we are in a switch(event.type) statement */
    • Show all 10 messages in this topic