Hi Adrian,
> Windows applications take it as 2 bytes and "DOS". are taken as 1 byte.
> I do not know at what point they become.
>
> Either way I would like to know how to make not ingnore Harbour.
>
> In Visual Basic or Visual Fox, depending on the function it transforms
> into "?", But I see them. Although with that reached me!
Isn't all this rather irrelevant? The barcode reader is not reading text
but data. As I understand it, you are using a keyboard wedge which
inserts the barcode data in the keyboard buffer. If the receiving
application interprets the data as text and the data contains bytes with
ASCII values below 32, then your final result will be wrong.
You are apparently reading GS1-128 barcodes with multiple fields
separated by the GS character, which equals chr(29). Harbour's standard
get reader first handles various K_CTRL_* codes and navigation codes.
When all such special key codes are exhausted it checks if the code is
>= 32 and <= 255 and puts the code in the active get if so. So chr(29)
will be ignored.
As I said when you first asked about chr(29) in September the solution
is to write a custom get reader that does not skip key codes outside the
default interval.
The key handler is in the GetApplyKey() method of the HBGetList class in
src\rtl\getlist.prg. Subclass HBGetList into your own HBGetListBarCode
class (or whatever you want to call it). The subclass only needs one
single method, GetApplyKey(). Everything else can be used straight from
the superclass. Borrow the code from the GetApplyKey() method in
getlist.prg to your subclass and make the changes you need. You also
need a custom ReadModal() function, ReadModalBarcode() or something like
that, that uses your subclass instead of the default HBGetList class
(see src\rtl\getsys.prg), and you need to call that custom
ReadModalBarcode() function instead of the default ReadModal() that the
read command is preprocessed into.
In GetApplyKey() you should take special precations with the K_CTRL_HOME
key code (which is 29) and handle that key code right in that CASE if
the Ctrl key is not active. nShifts := hb_gtinfo( HB_GTI_KBDSHIFTS )
will get you the status of the various shift keys and hb_bitor( nShifts,
HB_GTI_KBD_CTRL ) will tell you if the Ctrl key is active. I use a
similar test to distinguosh beween K_CTRL_C / K_PGDN and K_CTRL_V / K_INS
I do not have all the GS1-128 key codes in front of me right now, but
there might be other special cases than 29 that also need to be handled
separately in GetApplyKey().
Regards,
Klas