Context
Barcode scanner devices basically work as a normal keyboard attached to a phone, meaning it needs focus at some place on the screen where to put the scanned barcode. With barcode scanners with a touchscreen, it is very easy to unintentional lose the focus on the barcode field (even when there is only one editable task field and a default that sets @cursor_to_col_id), which will insert the barcode in the wrong field or not at all. For production/warehouse workers, this is simply not workable since scanning a barcode should just work without having to even look at the screen.
Idea
With this idea I would like a solution to make a fail-proof barcode scanner with the universal GUI which isn't limited to requiring focus on a specific field. In fact it should be optional to even show the barcode field to the user, since most times a barcode doesn't say much to the user.
Possible solution
A possible solution could be a setting at a tab-task. When a screen with that tab-task is opened in the Universal GUI, it will catch keyboard input and execute the task with the scanned input in the first parameter with a barcode domain. When there are more editable fields in the task, the task should not execute directly but open (with the barcode field filled in) so that the user can give input for the other parameters.
Side notes
Important for this solution to be viable, is that it would always catch the keyboard input when the screen is opened. So even when the focus is on a different part of the screen, like a detail window or the breadcrum/title bar.
It should also distinguish the on-screen keyboard/normal keyboard from the barcode scanner input (with a prefix or time-based).
Quick and dirty
As a quick and dirty solution, would it be possible to add a custom javascript event listener that catches the keyboard input, distinguishes barcode input and calls Indicium to insert a record or execute a tab-task? Something similar as