I have a webpage written in React (but it should not be strictly relevant to that question) that is composed by several inputs, let's call them Name, Surname and Code.
To work quickly, the insertion of the code is done with a Barcode Scanner that works as external keyboard. My idea is that if some field is focused, the keypress is inserted in the focused input but, in case no input is focused, I want to automatically focus and fill the Code input.
Is there a way to that it easily?
question from:
https://stackoverflow.com/questions/65642110/how-to-set-default-input-for-input-keypress 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…