docs: function tapButton(val) {  // {{{2
    var name = val.wrap.attr('label');
  
    switch (val.wrap.val()) {
    case '':
    case null:
    case undefined:
    case 'off':  // Button is "off", change it to "auto".
      val.wrap.val('auto');
  
      break;
    case 'on':  // Button is "on", change it to "off" and send "keyup".
      val.wrap.val('off');
  
      switch (name) {
      case 'shift':  // When "shift" is released, release mouse button "1".
        if (this.entry.sval.mods[1]) this.sendButton(1, false);
        // NO BREAK
      case 'control':
      case 'alt':
      case 'super':
        if (name in this.entry.sval.mods && this.entry.sval.mods[name]) this.sendKey('up', name);
        break;
      }
  
      break;
    case 'auto':  // Button is "auto", change it to "on" and send "keydown".
      val.wrap.val('on');
  
      if (name in this.entry.sval.mods && ! this.entry.sval.mods[name]) this.sendKey('down', name);
  
      break;
    default:
      throw new Error('Invalid button state: ' + val.wrap.val());
    }
  
    return false;
  }