Skip to content

Custom mode

Đặng Đoàn Đức Trung edited this page Jul 20, 2020 · 1 revision

Important

First, to set bongo cat to use the custom mode, you need to set mode to 5.

Key

key is simple: it represents an image that is triggered by pressing some buttons on your keyboard.

Each key contains two fields:

  • keyCodes: an array of key-codes (learn about key-codes in this page) that will trigger the image when pressed.
  • image: the path of the image that will be displayed when one of the previously mentioned key-codes is pressed.

For example:

{
    "image": "img/taiko/rightcentre.png",
    "keyCodes": [67]
}

will trigger the img/taiko/rightcentre.png image when you press C (aka key-code 67).

Key containers

The most important concept of custom mode is key container. Each key container contains some different keys, where each key cannot coexists with each other. For example, in taiko, the right hand, which contains the right rim and the right centre, is a key container, and the right rim and the right centre cannot be activated at the same time.

Each key container contains two fields:

  • defaultImage, which is used when no keys in the container are being pressed (hence default).
  • keys: an array of keys. These keys cannot mutually coexist (i.e. only one key will be triggered even if you activate multiple keys at once).

For example:

{
    "defaultImage": "img/taiko/rightup.png",
    "keys": [
        {
            "image": "img/taiko/rightcentre.png",
            "keyCodes": [67]
        },
        {
            "image": "img/taiko/rightrim.png",
            "keyCodes": [86]
        }
    ]
}

represents the key container for the right hand. Here, if neither the right centre nor the right rim is pressed, img/taiko/rightup.png will be shown. On the other hand, if either or both are pressed, then only one of img/taiko/rightcentre.png or img/taiko/rightrim.png is shown.

The custom mode structure

Finally, to represent a custom mode, you only have to specify two fields:

  • background: the background image for the custom mode.
  • keyContainers: an array containing key containers. These key containers are independent, so if multiple containers are activated, all of them are going to be displayed.

For example:

"custom": {
    "background": "img/taiko/bg.png",
    "keyContainers": [
        {
            "defaultImage": "img/taiko/rightup.png",
            "keys": [
                {
                    "image": "img/taiko/rightcentre.png",
                    "keyCodes": [67]
                },
                {
                    "image": "img/taiko/rightrim.png",
                    "keyCodes": [86]
                }
            ]
        },
        {
            "defaultImage": "img/taiko/leftup.png",
            "keys": [
                {
                    "image": "img/taiko/leftcentre.png",
                    "keyCodes": [88]
                },
                {
                    "image": "img/taiko/leftrim.png",
                    "keyCodes": [90]
                }
            ]
        }
    ]
}

is the complete configuration for taiko, written in custom mode.

Now, the last thing is to copy your custom config and paste it in the "custom" section.

Clone this wiki locally