code: func DeduceButtonInfo(state uint16,
  	detail xproto.Button) (uint16, xproto.Button) {
  
  	mods, button := state, detail
  	for _, m := range xevent.IgnoreMods {
  		mods &= ^m
  	}
  
  	// We also need to mask out the button that has been pressed/released,
  	// since it is also typically a modifier.
  	modsTemp := int32(mods)
  	switch button {
  	case 1:
  		modsTemp &= ^xproto.ButtonMask1
  	case 2:
  		modsTemp &= ^xproto.ButtonMask2
  	case 3:
  		modsTemp &= ^xproto.ButtonMask3
  	case 4:
  		modsTemp &= ^xproto.ButtonMask4
  	case 5:
  		modsTemp &= ^xproto.ButtonMask5
  	}
  
  	return uint16(modsTemp), button
  }
docs: // DeduceButtonInfo takes a (modifiers, button) tuple and returns the relevant
  // modifiers that were activated. This accounts for modifiers in
  // xevent.IgnoreMods and the the button mask of the button that is pressed.