Quantcast
Channel: Keyboard handler for moving in four directions - Code Review Stack Exchange
Browsing latest articles
Browse All 3 View Live

Answer by 200_success for Keyboard handler for moving in four directions

In this case, I think that default: would be noise. It's obvious that this code makes no attempt to handle every possible keycode.I suggest using a variant of @SirPython's suggestion to use a lookup...

View Article


Answer by SirPython for Keyboard handler for moving in four directions

Your code is rather short, but can still be greatly improved.Should I keep the default: break; or not?Do not keep it. Since you aren't doing anything for the default case, there is no point in having...

View Article


Keyboard handler for moving in four directions

I'm having trouble deciding if I should leave the default: break; in the switch statement or not. It does kinda show intent, i.e. that most keys are not handled, but it's also effectively useless code....

View Article
Browsing latest articles
Browse All 3 View Live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>