void OnButton(EmulatorTouchEvent.Action action, EmulatorButtonEvent.ButtonCode buttonCode) { var btn = PhoneEvent.Types.KeyEvent .CreateBuilder() .SetAction((int)action) .SetCode((int)buttonCode) .Build(); Enqueue(new Entry { type = TypeOfEvent(btn), bytes = btn.ToByteArray() }); }
void OnMotion(IEnumerable <TouchData> touches, EmulatorTouchEvent.Action action) { var motion = PhoneEvent.Types.MotionEvent .CreateBuilder() .SetTimestamp(GetTimestamp()) .SetAction((int)action) .AddRangePointers(TouchesToPointers(touches)) .Build(); Enqueue(new Entry { type = TypeOfEvent(motion), bytes = motion.ToByteArray() }); }
void OnApp(EmulatorTouchEvent.Action action) { OnButton(action, EmulatorButtonEvent.ButtonCode.kApp); }
void OnHome(EmulatorTouchEvent.Action action) { OnButton(action, EmulatorButtonEvent.ButtonCode.kHome); }