barcode reader with unicode chars
Unsolved
General and Desktop
-
Just small update on using barcode scanner on Linux. Unicode entry via keyboard on full Linux is possible on following ways:
- Hold SHIFT + CONTROL + u + hex code, release and char will appear - hex entered via numeric keypad, hex A-F via regular keypad {e.g. SHIFT + CONTROL + u + 5320 or SHIFT + CONTROL + u + 30B7}.
- Hold SHIFT + CONTROL and press u, release keys, type hex (unicode char), press enter and char will appear - hex entered via regular keypad {e.g. SHIFT + CONTROL + u, release, then 5320, then enter}.
As we are using embedded Linux solution with EGLFS mode, none of this unicode entry works with the Qt. Also ALT+hex combination from windows does not work. Besides that, barcode scanner does not support SHIFT + CONTROL + u Linux mode.
To overcome this, I played with key press event filter to catch keys ALT, + and the following hex code. And when ALT gets released, I just convert the caught code to the actual char with the following code.
bool ok = false; QString g = QChar(arg.toInt(&ok, 16)); // conversion of the hex sequence to the actual char
Works really well, just need to do some more tests.