Ejemplo n.º 1
0
        private bool SendFreetrackInterface(IVirtualDevice device, IntPtr handle)
        {
            object[] modifiedKeys = device.GetModifiedKeys(VirtualDeviceCapability.Axis);
            foreach (object key in modifiedKeys)
            {
                KeyState state     = device.GetKeyState(VirtualDeviceCapability.Axis, key);
                int      axisIndex = Ivj.GetFreetrackAxisIndex(key);
                if (axisIndex > -1)
                {
                    Ivj.SetFreetrackAxis(handle, axisIndex, state.SmoothAxis, state.RawAxis);
                }
            }
            bool result = Ivj.SendFreetrackInterface(handle);

            device.Send();
            return(result);
        }
Ejemplo n.º 2
0
        private bool SendKeyboard(IVirtualDevice device, IntPtr handle)
        {
            object[] modifiedKeys = device.GetModifiedKeys(VirtualDeviceCapability.Key);
            foreach (object key in modifiedKeys)
            {
                KeyState state    = device.GetKeyState(VirtualDeviceCapability.Key, key);
                int      keyIndex = Ivj.GetKeyboardKeyIndex(key);
                if (keyIndex > -1)
                {
                    Ivj.SetKeyboardKey(handle, keyIndex, state.SmoothPressed);
                }
            }
            bool result = Ivj.SendKeyboard(handle);

            device.Send();
            return(result);
        }