On Thu, 06 Mar 2008, Lorenzo Fiorini wrote:
> >  So please run tests/gtkeys.prg with //gtstd and check what is shown
> >  for K_ALT_A:
> With "standard" OS X Teminal App, iTerm App and putty:
> char: 195
> char: 165

Fine. Now you can add workaround for it yourself by simple:
   hb_gtInfo( HB_GTI_ADDKEYMAP, { K_ALT_A, chr( 195 ) + chr( 165 ) } )
but if you want me to add more generic support for it then we should
check more general rules used by MaxOSX for ALT keys.
So first we should check is console is in UTF-8 mode and if GTTRM
detected it automatically. The values suggests that it's single UTF-8
character but GTTRM cannot detect UTF8 mode.
   ? HB_UTF8PEEK( chr( 195 ) + chr( 165 ), 1 ) // => 229 == 0xE5

What shows:

   #include "hbgtinfo.ch"
   proc main()
      ? hb_gtInfo(HB_GTI_ISUNICODE)
   return

Just try to make also:
   printf "[\xc3\xa5]\n"
from bash and check how many characters will be shown. Check your PuTTY
configuration, disable UTF-8 and check how many keys will be returned
for K_ALT_A (still 2 or 1?) BTW. Are the above two bytes sent together
or first one is set when you hit ALT and second when you hit A.
Finally check other key values to find global decoding rules. It's
possible that with ALT you simply have some other characters on MacOSX
so please also test some of cursor keys with ALT combination, f.e.
escape sequences for K_LEFT and K_ALT_LEFT, K_RIGHT and K_ALT_RIGHT,
K_ENTER and K_ALT_ENTER
If you answer for all of the above questions (and maybe some others,
BTW what is your TERM envvar) then we can add general support for MacOSX
and PuTTY to GTTRM if it needs some additional code. But I'm still not
sure if it's really necessary. It's possible that only UTF-8 mode was
not detected automatically. Unfortunately there is no standard way to
make it and I have to use small hack. It's possible that it does not
work with PuTTY MacOSX port. If yes then I can try to update it.

best regards,
Przemek
_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to