Detect whether browser has keyboard/arrow keys in web page

前端 未结 8 891
忘了有多久
忘了有多久 2020-12-31 00:21

I have a full-screen game in HTML+JavaScript, which uses the arrow keys as primary controls. This cannot be used on keyboardless Android devices (I haven\'t tested on iOS),

8条回答
  •  有刺的猬
    2020-12-31 01:18

    rather than displaying the on-screen keyboard by default, add a button to toggle the display of the on-screen keyboard.

    It might also be prudent to give the on-screen keyboard the ability to be resized.

    Edit to answer question:

    Keyboard should be hidden by default if most of your users are going to be on a computer,

    Visible by default if most of your users are going to be on a mobile device.

提交回复
热议问题