porridge / bambam

keyboard mashing and doodling game for babies and toddlers
GNU General Public License v3.0
71 stars 36 forks source link

Added user warning of CAPSLOCK and NUMLOCK changes #17

Closed RaymondFallon closed 7 years ago

RaymondFallon commented 7 years ago

Bambam was able to alter a bit of the computer's state during execution, namely: turning on/off CAPSLOCK and NUMLOCK. Pygame seems ill-equipped to fix this problem, so I added a user-warning. It is activated once CAPS or NUMLOCK is turn on for the first time.

porridge commented 7 years ago

Thanks for the PR. I see a few issues with it:

  1. ideally, we'd just reset Caps/Scroll/Num lock keys to whatever setting they were set when the program was started. However there does not seem to be a portable/sane way to do this from within Python.
  2. the next best thing would be to show a warning on the screen, however when it is filled with numerous effects of your child's work, it might be as hard to notice as the hardware LED on the keyboard. I guess it depends on how it's done. A little red key icon in the corner might be nice.
  3. the only other thing is what you did, i.e. display a warning on the terminal after shutting down. The problem with that is that it will not be visible at all to anyone launching the program from a GUI menu.
  4. on top of that, the ambiguity of the message makes it somewhat confusing. It's like "Watch out! Something might be wrong or completely fine!" :smile:

All in all, I think the introduced complexity is not worth the effect. I guess I could accept a PR that either printed a non-ambiguous message (by comparing pygame.key.get_mods() output at begging and end for example), or (even better) showed a graphical indicator of the modified keys on the screen while running.