 pressed
               return Boolean(event.buttons & (1 << buttonNames.indexOf(buttonName)));
            }

            function format(event) {
              const { type, buttons } = event;
              const obj = { type };
              for (const buttonName of buttonNames) {
                obj[buttonName] = mouseButtonPressed(event, buttonName);
              }
              return JSON.stringify(obj, null, 2);
            }

            const log = document.getElementById("log");
            func