How do I detect a keyboard?

  • I'm working on a game that can be played either with KB + mouse or using a controller, but the game has a key rebinding option. I want to hide this option if the platform doesn't have a keyboard (such as playing in a console, for example). My first idea was to wait for an input at the beginning of the game, and if that input didn't come from a KB, then assume there's no KB and hide the option, but the user could just use the mouse as the first input and the option wouldn't show, even tho there is a KB, so the ideal would be to detect a KB. Is that possible?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I don't think it's possible. You can detect a preferred input method by displaying a message "Press to continue" and listening for keyboard/gamepad/mouse events. But also allow to change it later in settings.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)