public bool IsGuitarButtonPressed(GuitarButtons guitarButtons) { UInt16 value = (UInt16)guitarButtons; UInt16 orig = (UInt16)Guitar.Buttons; return((orig & value) == value); }
protected void ParseExtensionData(byte[] buffer, int offset, int count) { for (int i = offset; i < offset + count; i++) { buffer[i] = (byte)((buffer[i] ^ 0x17) + 0x17 & 0xFF); } _Stick.X = buffer[offset + 0]; _Stick.Y = buffer[offset + 1]; _WhammyBar = buffer[offset + 3]; _Buttons = ((buffer[offset + 4] & 4) == 0 ? GuitarButtons.None : GuitarButtons.Plus) | ((buffer[offset + 4] & 16) == 0 ? GuitarButtons.None : GuitarButtons.Minus) | ((buffer[offset + 4] & 64) == 0 ? GuitarButtons.None : GuitarButtons.Down) | ((buffer[offset + 5] & 1) == 0 ? GuitarButtons.None : GuitarButtons.Up) | ((buffer[offset + 5] & 8) == 0 ? GuitarButtons.None : GuitarButtons.Yellow) | ((buffer[offset + 5] & 16) == 0 ? GuitarButtons.None : GuitarButtons.Green) | ((buffer[offset + 5] & 32) == 0 ? GuitarButtons.None : GuitarButtons.Blue) | ((buffer[offset + 5] & 64) == 0 ? GuitarButtons.None : GuitarButtons.Red) | ((buffer[offset + 5] & 128) == 0 ? GuitarButtons.None : GuitarButtons.Orange); }
public bool button_down(GuitarButtons b) { return(data.IsGuitarButtonPressed(b)); }