How can I control a field must be input by barcode scanning

How can I control a field must be input by barcode scanning

I have a field must be input by barcode scanning.  So this form only can execute in native mobile mode.
How can I control this form can't execute in web mode?