Exemplo n.º 1
0
        public void KeyPressH()
        {
            var msg = new KeycodeControlMessage();

            msg.KeyCode   = AndroidKeycode.AKEYCODE_H;
            msg.Metastate = AndroidMetastate.AMETA_NUM_LOCK_ON;

            var expected = new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00 };
            var actual   = msg.ToBytes();

            CollectionAssert.AreEqual(expected, actual.ToArray());
        }
Exemplo n.º 2
0
        public void KeyReleaseO()
        {
            var msg = new KeycodeControlMessage();

            msg.Action    = AndroidKeyEventAction.AKEY_EVENT_ACTION_UP;
            msg.KeyCode   = AndroidKeycode.AKEYCODE_O;
            msg.Metastate = AndroidMetastate.AMETA_NUM_LOCK_ON;

            var expected = new byte[] { 0x00, 0x01, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00 };
            var actual   = msg.ToBytes();

            CollectionAssert.AreEqual(expected, actual.ToArray());
        }