現在ipad第4世代 safariでバーコードリーダー(bluetooth接続:キーボードモード)でバーコード読み込み、フォームに入れるという動作テストをしています。
<!doctype html> <html> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Content-Language" content="ja"> <meta http-equiv="content-script-type" content="text/javascript"/> <meta http-equiv="content-style-type" content="text/css"/> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"> <meta name="viewport" content="initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"> <head> <script type="text/javascript" src="js/jquery-3.1.1.min.js"></script> <script type="text/javascript"> var words = ''; $(document).keypress(function(e) { var key = String.fromCharCode(e.charCode); words = words + key; if(key=="E"){ //Eは最後の文字 $("#form").val(words); } }); </script> </head> <body> <inpu type="text" id="form"> </body> </html>
バーコードの文字列の最後は必ずEですので、最後を判定しフォームに格納しています。
通常safariのブラウジングでは動くのですが、「ホーム画面に追加」しフルスクリーンモードで動作させると機能しません。
$(document).keypress(function(e)
フルスクリーンモードではkeypress判定ができないのでしょうか?
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/03/08 01:52