Beispiel #1
0
    public static BBMacroOpCode InputType2OpCode(BBInputType type)
    {
        BBMacroOpCode code = BBMacroOpCode.None;

        switch (type)
        {
        case BBInputType.Press:
            code = BBMacroOpCode.Press;
            break;

        case BBInputType.Move:
            code = BBMacroOpCode.Move;
            break;

        case BBInputType.Release:
            code = BBMacroOpCode.Release;
            break;

        case BBInputType.Wheel:
            code = BBMacroOpCode.Wheel;
            break;

        case BBInputType.KeyDown:
            code = BBMacroOpCode.KeyDown;
            break;

        case BBInputType.KeyUp:
            code = BBMacroOpCode.KeyUp;
            break;
        }
        return(code);
    }
Beispiel #2
0
 public static bool IsMouseOpCode(BBMacroOpCode code)
 {
     return(code == BBMacroOpCode.Press ||
            code == BBMacroOpCode.Release ||
            code == BBMacroOpCode.Move ||
            code == BBMacroOpCode.Click ||
            code == BBMacroOpCode.Drag ||
            code == BBMacroOpCode.Wheel);
 }
Beispiel #3
0
    public virtual void Deserialize(BinaryReader reader)
    {
        code   = (BBMacroOpCode)reader.ReadByte();
        button = (BBInputButton)reader.ReadByte();
        key    = (BBVirtualKey)reader.ReadUInt16();
        int length = reader.ReadInt32();

        data = new float[length];
        for (int i = 0; i < length; i++)
        {
            data[i] = reader.ReadSingle();
        }
        times      = reader.ReadInt32();
        duration   = reader.ReadSingle();
        delay      = reader.ReadSingle();
        script     = reader.ReadString();
        scriptData = reader.ReadString();
    }
Beispiel #4
0
 public static bool IsKeyboardOpCode(BBMacroOpCode code)
 {
     return(code == BBMacroOpCode.KeyDown ||
            code == BBMacroOpCode.KeyUp ||
            code == BBMacroOpCode.KeyPress);
 }