简体   繁体   English

禁用条形码阅读器的iPhone键盘输入

[英]disable iphone keyboard input for barcoder reader

Hi i have input which is used for text received from barcode reader, but when you focus this input iphone and other mobile browsers display the software keyboard, and this hide all buttons under the input, which you need also for your work. 嗨,我有用于从条形码阅读器接收文本的输入,但是当您聚焦此输入时,iPhone和其他移动浏览器将显示软件键盘,并且这会将所有按钮隐藏在输入下方,这也是您工作所需的。

Is there a way how to disable this iphone keyboard for this input? 有没有办法禁用此输入的此iphone键盘? But blur is not solution, you need to type the barcode and press enter, that is what the reader do, it simulates the hardware keyboard. 但是模糊不是解决方案,您需要键入条形码并按Enter键,这是读取器所做的,它可以模拟硬件键盘。

If you pass your values to the text field with custom input, like with a datepicker for example, you can simply use readonly attribute in HTML or through JavaScript/jQuery: 如果您使用自定义输入将值传递到文本字段,例如使用日期选择器,则可以简单地在HTML或JavaScript / jQuery中使用readonly属性:

/**
 * @param {Object} el : cache.datepicker => input element
 * @augments myCustom.fn.devicedetection from detectmobilebrowsers.com
 */
disableKeyboard: function (el) {
    if (myCustom.fn.deviceDetection === 'mobile') {
        el.prop({ readonly: true });
    }
},

Now it's not very clear what you mean by you need to type the barcode and press enter , you might want to elaborate on that one. 现在还不清楚您需要输入条形码并按Enter键的意思 ,您可能需要详细说明一下。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM