Decoding QR-code using keyboard wedge in Android with barcode scanner

398 views Asked by At

I need to decode a "complex" QR code with Latin character and Thai character. I need to use the keyboard wedge function of Android using the following code:

@Override
public boolean dispatchKeyEvent(KeyEvent e)
{

    Log.i(TAG,"dispatchKeyEvent: "+ e.getKeyCharacterMap());
    if(e.getAction()==KeyEvent.ACTION_DOWN && e.getKeyCode() != KeyEvent.KEYCODE_ENTER)
    {
        char pressedKey = (char) e.getUnicodeChar();
        scannerCharacter += pressedKey;
    }        
    return super.dispatchKeyEvent(e);
}

Here is the QR code I need to decode: (HH;อาณาจักร)

enter image description here

All the barcode scanner with keyboard wedge I tried did not successfully read the QR. Here is the result they get: HHò________

If you try with a common android app that uses, for example, Zxing you will be able to decode the QR code. Do you have some tips on how to decode this barcode using keyboard wedge?

0

There are 0 answers