toddmedema / electrify

Take Charge of the Power Market
http://electrifygame.com
MIT License
6 stars 2 forks source link

Consider removing hotkey tips for mobile users #101

Closed n-hebert closed 2 months ago

n-hebert commented 2 months ago

It seems we can detect mobile users via src/Globals.tsx::export function isSmallScreen(), so it could be a good idea to avoid printing out tips about hotkeys (e.g. first blurb on Tutorial 4) if they are on mobile, as they probably aren't using a keyboard.

This issue may be more of a discussion, but we don't have discussions on for the repo at the current time :smile:

toddmedema commented 2 months ago

TIL about GitHub discussions - enabled!

My first thought was, heck yes! But I very quickly ran into ton of edge cases as pointed out here https://stackoverflow.com/questions/18880236/how-do-i-detect-hardware-keyboard-presence-with-javascript, for example:

  1. Small screens with physical keyboards, or keyboards paired via bluetooth
  2. Big screens without physical keyboards, e.g. tablets
  3. Touch screens that also have keyboards, e.g. touchscreen PCs with keyboards

And I'm not finding any good ways to detect specifically the presence of a hardware keyboard - certainly nothing official or widely supported (e.g. https://forum.ionicframework.com/t/how-to-detect-a-physical-keyboard/212690/2 )

n-hebert commented 2 months ago

Excellent points at all!

This is pretty low-value at the current time. We can close knowing that if something changes to make that more obvious we can re-open, or re-open if it becomes more pressing.

Thanks for the discussions area, too!