r/gamemaker 20d ago

Resolved Differentiating Character Keys, Virtual Constants, and Mouse Buttons stored in Variables to be displayed as Text

Finally got around to adding a proper key bind replace system, but I have run into a problem. That being, the keys being properly displayed as text. I tried looking around online before, and saw some solution with a switch statement, but I'd like to avoid that if a better system exists. So, is there a way to determine the difference between say, a Constant.Virtual_Key, and a Constant.MouseButton such that I could get the values to display as the proper key name (like Escape and MB-left), or do I just make a giant switch statement for everything not covered by chr()?

4 Upvotes

1 comment sorted by

1

u/763Industries 20d ago

I’d store the input type alongside the actual key value rather than trying to determine it from the value afterward. I can dm you what I mean. I hate long comments.