JohnEarnest / Octo

A Chip8 IDE
MIT License
664 stars 53 forks source link

Gamepad visible in browser #158

Open tobiasvl opened 2 years ago

tobiasvl commented 2 years ago

When exporting an Octo game to HTML and choosing the "Gamepad" option as the game's touch mode, the gamepad overlay seems to be visible (but unresponsive) in the desktop browser version, even though the gamepad is only supported on touch devices.

pushfoo commented 2 years ago

Would making it capable of responding when on desktop be useful? I can see it as useful for turn-based strategy games.

tobiasvl commented 2 years ago

Perhaps, but IMO it's a little awkward to have the gamepad cover the screen when you're on a computer where there's much more screen real estate than on a cell phone.

Personally, to achieve almost the same thing without an overlay, I'd rather draw the buttons myself in the corners, using the Seg16 touch mode to make the buttons respond to mouse clicks.

pushfoo commented 10 months ago

even though the gamepad is only supported on touch devices.

It should be possible to make it work on desktop since the browser gamepad API has been supported fairly universally since 2012.

JohnEarnest commented 10 months ago

I experimented briefly with the gamepad API a few years ago, and found that Safari, Firefox, and Chrome all had seriously inconsistent behavior and completely failed to detect most of the gamepads I had on hand. I'm open to the idea of gamepad support if somebody else wants to do the work and prepare a PR, but I absolutely do not want to add support if it will only work correctly on Chrome.