The next big Game Boy event is here! “GB Compo 25” starts May 31st, and lasts 3 months. Sponsored by ModRetro, there is over $5000 USD in cash & physical prizes!! Be sure to check it out on itch.io at: https://itch.io/jam/gbcompo25. Tag me on Twitter/X if you submit an entry, i’d love to see what you made!

keypad input in butano game engine

Handling keypad input on the Game Boy Advance

Joypad Input with Butano is very simple. All of the hard-work is done for you. The engine provides functions for whatever you may need.

Firstly, like all Butano features, you’ll need to include the proper header file. For input, you’ll really only need to include

#include 

After that, all of the functions you need are in the “bn::keypad” namespace. You can find the documentation for this namespace here: Butano Docs – bn::keypad namespace.

Easy Keypad Functions in Butano

Butano has easy functions for common button operations:

  • bn::keypad::
  • bn::keypad::
  • bn::keypad::

Where

Leave a Reply

Your email address will not be published. Required fields are marked *

THANKS FOR READING!

If you have any suggestions, and/or are confused about anything: feel free to leave a comment, send me a email, or a message on social media. Constructive criticism will help the gameyard, and others like yourself. If you learned something from this tutorial, and are looking for more content, check other these other tutorials. 

Handling keypad input on the Game Boy Advance

Thanks for reading my tutorial, here are the files for that tutorial. 

Download Instructions

You’ll need the Butano Game Engine installed to run this. In addition, you’ll need the ability to run Makefiles. After you unzip the code, Make sure you update the LIBBUTANO . It should point to the “butano” folder INSIDE of your butano download folder. For me it was “c:/butano/butano”. After that, you can create your .gba file by running make.

If you want to make/request changes for the code, you can send me an email or put in a PR request on GitHub. Here’s a GitHub link for the code below.

Sign-Up for the "Gameyard Newsletter" for MOre Game Development News

If you like Retro Game Development, subscribe to the Gameyard Newsletter. Stay up-to-date with all the latest Game Boy news. It’s free, and you can unsubscribe any time!

Be sure to check your email inbox for a confirmation email.