Toddler Button Masher

My one-year old son loves interacting with technology. Cell phones, remote controls, keyboards, mice. It’s great, and I want to encourage healthy tech literacy. The problem is that he is still learning and most tech out there is built for adults, not children.

Even the games that are built for children are impacted by adult interfaces. It is far too easy for a toddler to activate search and task management features on a touch input device. These are part of a larger problem at the OS level, where a lot of assumptions about the age and skill level of the user are being made. Like the rest of us, he has learned to adapt in order to get the results he wants from the device.

Button Mashing

There isn’t much distinction between the keys on the keyboard when you haven’t learned the alphabet. So, that’s the level of sophistication that I started with: basic keypress.

The approach is exceptionally simple. I attached four sound files to the scene, and play one of the sounds based on keyboard input while setting a random background colour.

Testing went very well. My son started interacting with the keyboard and mouse immediately, enjoying the sounds and changing colours.

App and Code

This simple app is available as a download, as well as providing the source code below and in a repository.

Source Code

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class mainScript : MonoBehaviour
{
    public Camera cam;
    public Color color1 = Color.red;
    public Color color2 = Color.blue;
    public float duration = 3.0F;

    public AudioSource audioSource;
    public AudioSource audioSourceBonus1;
    public AudioSource audioSourceBonus2;
    public AudioSource audioSourceBonus3;
    public AudioSource audioSourceBonus4;

    // Start is called before the first frame update
    void Start()
    {
        cam = GetComponent<Camera>();
        cam.clearFlags = CameraClearFlags.SolidColor;

        audioSource = GetComponent<AudioSource>();
        audioSource.Play(0);

        audioSourceBonus1 = GameObject.Find("AudioSourceBonus1").gameObject.GetComponent<AudioSource>();
        audioSourceBonus2 = GameObject.Find("AudioSourceBonus2").gameObject.GetComponent<AudioSource>();
        audioSourceBonus3 = GameObject.Find("AudioSourceBonus3").gameObject.GetComponent<AudioSource>();
        audioSourceBonus4 = GameObject.Find("AudioSourceBonus4").gameObject.GetComponent<AudioSource>();
    }

    // Update is called once per frame
    void Update()
    {
        //play sound
        if (Input.GetKeyDown(KeyCode.Space))
        {
            audioSourceBonus1.Play(0);
        }
        else if (Input.GetKeyDown(KeyCode.Return))
        {
            audioSourceBonus2.Play(0);
        }
        else if (Input.GetKeyDown(KeyCode.UpArrow) || Input.GetKeyDown(KeyCode.DownArrow) || Input.GetKeyDown(KeyCode.LeftArrow) || Input.GetKeyDown(KeyCode.RightArrow))
        {
            audioSourceBonus3.Play(0);
        }
        else if (Input.GetKeyDown(KeyCode.Escape))
        {
            audioSourceBonus4.Play(0);
        }
        else if (Input.anyKeyDown)
        {
            Debug.Log("Some key was pressed.");

            audioSource.Play(0);
        }

        //change background color
        if (Input.anyKeyDown)
        {
            cam.backgroundColor = Random.ColorHSV(0f, 1f, 1f, 1f, 0.1f, 0.2f);
        }
    }
}

Repository

The assets are stored in a GitHub repository.

https://github.com/revnoah/toddler-button-masher