Simplified usages in UIX project

This commit is contained in:
Joshua Askharoun
2021-04-02 19:10:51 -05:00
parent 2b20ca46ad
commit c07b53bb0b
464 changed files with 14054 additions and 14064 deletions
+5 -5
View File
@@ -37,16 +37,16 @@ namespace Microsoft.Iris.Input
InputModifiers modifiers,
DragOperation operation)
{
this._modifiers = modifiers;
this._operation = operation;
this.Initialize(rawSource, x, y, EventTypeForDragOperation(operation));
_modifiers = modifiers;
_operation = operation;
Initialize(rawSource, x, y, EventTypeForDragOperation(operation));
}
protected override InputInfo.InfoType PoolType => s_poolType;
public InputModifiers Modifiers => this._modifiers;
public InputModifiers Modifiers => _modifiers;
public DragOperation Operation => this._operation;
public DragOperation Operation => _operation;
private static InputEventType EventTypeForDragOperation(DragOperation operation)
{
@@ -58,9 +58,9 @@ namespace Microsoft.Iris.Input
private HIDCommandMapping(CommandCode command, uint usage, uint usagePage)
{
this._command = command;
this._usage = usage;
this._usagePage = usagePage;
_command = command;
_usage = usage;
_usagePage = usagePage;
}
public static CommandCode Find(uint usage, uint usagePage)
+2 -2
View File
@@ -10,8 +10,8 @@ namespace Microsoft.Iris.Input
{
private InputManager _manager;
internal InputDevice(InputManager manager) => this._manager = manager;
internal InputDevice(InputManager manager) => _manager = manager;
internal InputManager Manager => this._manager;
internal InputManager Manager => _manager;
}
}
+32 -32
View File
@@ -19,10 +19,10 @@ namespace Microsoft.Iris.Input
protected void Initialize(InputEventType eventType)
{
this._eventType = eventType;
this._lockCount = 0;
this._routeTruncated = false;
this._handled = false;
_eventType = eventType;
_lockCount = 0;
_routeTruncated = false;
_handled = false;
}
[Conditional("DEBUG")]
@@ -46,46 +46,46 @@ namespace Microsoft.Iris.Input
protected virtual void Zombie()
{
this._target = null;
this._eventType = InputEventType.Invalid;
_target = null;
_eventType = InputEventType.Invalid;
}
protected static InputInfo GetFromPool(InputInfo.InfoType poolType) => s_pools[(int)poolType].GetPooledInfo();
public void ReturnToPool()
{
if (!this.Poolable)
if (!Poolable)
return;
s_pools[(int)this.PoolType].RecycleInfo(this);
s_pools[(int)PoolType].RecycleInfo(this);
}
private bool Poolable => this._lockCount == 0;
private bool Poolable => _lockCount == 0;
public void Lock() => ++this._lockCount;
public void Lock() => ++_lockCount;
public void Unlock()
{
--this._lockCount;
if (this._lockCount != 0)
--_lockCount;
if (_lockCount != 0)
return;
this.ReturnToPool();
ReturnToPool();
}
public bool Handled => this._handled;
public bool Handled => _handled;
public void MarkHandled() => this._handled = true;
public void MarkHandled() => _handled = true;
public bool RouteTruncated => this._routeTruncated;
public bool RouteTruncated => _routeTruncated;
public ICookedInputSite Target => this._target;
public ICookedInputSite Target => _target;
public virtual InputEventType EventType => this._eventType;
public virtual InputEventType EventType => _eventType;
public void TruncateRoute() => this._routeTruncated = true;
public void TruncateRoute() => _routeTruncated = true;
public virtual void UpdateTarget(ICookedInputSite target) => this._target = target;
public virtual void UpdateTarget(ICookedInputSite target) => _target = target;
public override string ToString() => this.GetType().Name;
public override string ToString() => GetType().Name;
private struct InfoPool
{
@@ -93,15 +93,15 @@ namespace Microsoft.Iris.Input
private int _maxEntries;
private object _storage;
public void SetLimitMode(bool keepSingle) => this._maxEntries = keepSingle ? 1 : 10;
public void SetLimitMode(bool keepSingle) => _maxEntries = keepSingle ? 1 : 10;
public InputInfo GetPooledInfo()
{
InputInfo inputInfo = null;
if (this._numEntries > 0)
if (_numEntries > 0)
{
inputInfo = this._maxEntries != 1 ? ((InputInfo[])this._storage)[this._numEntries - 1] : (InputInfo)this._storage;
--this._numEntries;
inputInfo = _maxEntries != 1 ? ((InputInfo[])_storage)[_numEntries - 1] : (InputInfo)_storage;
--_numEntries;
}
return inputInfo;
}
@@ -109,20 +109,20 @@ namespace Microsoft.Iris.Input
public bool RecycleInfo(InputInfo info)
{
bool flag = false;
if (this._numEntries < this._maxEntries)
if (_numEntries < _maxEntries)
{
info.Zombie();
if (this._maxEntries == 1)
if (_maxEntries == 1)
{
this._storage = info;
_storage = info;
}
else
{
if (this._storage == null)
this._storage = (new InputInfo[this._maxEntries]);
((InputInfo[])this._storage)[this._numEntries] = info;
if (_storage == null)
_storage = (new InputInfo[_maxEntries]);
((InputInfo[])_storage)[_numEntries] = info;
}
++this._numEntries;
++_numEntries;
flag = true;
}
return flag;
+18 -18
View File
@@ -49,41 +49,41 @@ namespace Microsoft.Iris.Input
return inputItem;
}
public void ReturnToPool() => this.ReturnToPool(true);
public void ReturnToPool() => ReturnToPool(true);
private void ReturnToPool(bool returnInfoToo)
{
if (returnInfoToo)
this._info.ReturnToPool();
this._manager = null;
this._target = null;
this._info = null;
this._prev = null;
this._next = null;
this._owner = null;
_info.ReturnToPool();
_manager = null;
_target = null;
_info = null;
_prev = null;
_next = null;
_owner = null;
if (s_cachedCount >= 5)
return;
this._next = s_cache;
_next = s_cache;
s_cache = this;
++s_cachedCount;
}
public InputManager Manager => this._manager;
public InputManager Manager => _manager;
public InputInfo Info => this._info;
public InputInfo Info => _info;
public override string ToString() => base.ToString() + " -> " + _info + " -> " + DebugHelpers.DEBUG_ObjectToString(_target);
public override void Dispatch()
{
if (this._info.Target == null)
this._info.UpdateTarget(this._target);
this._info.Lock();
this._manager.DeliverInput(this._target, this._info);
this._info.Unlock();
this.ReturnToPool(false);
if (_info.Target == null)
_info.UpdateTarget(_target);
_info.Lock();
_manager.DeliverInput(_target, _info);
_info.Unlock();
ReturnToPool(false);
}
internal void UpdateInputSite(ICookedInputSite target) => this._target = target;
internal void UpdateInputSite(ICookedInputSite target) => _target = target;
}
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+19 -19
View File
@@ -31,15 +31,15 @@ namespace Microsoft.Iris.Input
int scanCode,
ushort eventFlags)
{
this._systemKey = systemKey;
this._action = action;
this._deviceType = deviceType;
this._modifiers = modifiers;
this._repeatCount = repeatCount;
this._nativeMessageID = nativeMessageID;
this._scanCode = scanCode;
this._eventFlags = eventFlags;
this.Initialize(eventType);
_systemKey = systemKey;
_action = action;
_deviceType = deviceType;
_modifiers = modifiers;
_repeatCount = repeatCount;
_nativeMessageID = nativeMessageID;
_scanCode = scanCode;
_eventFlags = eventFlags;
Initialize(eventType);
}
protected void Initialize(
@@ -47,25 +47,25 @@ namespace Microsoft.Iris.Input
InputEventType eventType,
InputDeviceType deviceType)
{
this.Initialize(action, eventType, deviceType, InputModifiers.None, 1U, false, 0U, 0, 0);
Initialize(action, eventType, deviceType, InputModifiers.None, 1U, false, 0U, 0, 0);
}
public KeyAction Action => this._action;
public KeyAction Action => _action;
public InputDeviceType DeviceType => this._deviceType;
public InputDeviceType DeviceType => _deviceType;
public InputModifiers Modifiers => this._modifiers;
public InputModifiers Modifiers => _modifiers;
public uint RepeatCount => this._repeatCount;
public uint RepeatCount => _repeatCount;
public bool SystemKey => this._systemKey;
public bool SystemKey => _systemKey;
public uint NativeMessageID => this._nativeMessageID;
public uint NativeMessageID => _nativeMessageID;
public int ScanCode => this._scanCode;
public int ScanCode => _scanCode;
public ushort KeyboardFlags => this._eventFlags;
public ushort KeyboardFlags => _eventFlags;
public bool IsRepeatOf(KeyActionInfo other) => other != null && this._action == other._action && (this._deviceType == other._deviceType && this._systemKey == other._systemKey) && this._modifiers == other._modifiers;
public bool IsRepeatOf(KeyActionInfo other) => other != null && _action == other._action && (_deviceType == other._deviceType && _systemKey == other._systemKey) && _modifiers == other._modifiers;
}
}
+4 -4
View File
@@ -46,14 +46,14 @@ namespace Microsoft.Iris.Input
int scanCode,
ushort eventFlags)
{
this._character = character;
this.Initialize(action, InputEventType.KeyCharacter, deviceType, modifiers, repeatCount, systemKey, nativeMessageID, scanCode, eventFlags);
_character = character;
Initialize(action, InputEventType.KeyCharacter, deviceType, modifiers, repeatCount, systemKey, nativeMessageID, scanCode, eventFlags);
}
public char Character => this._character;
public char Character => _character;
protected override InputInfo.InfoType PoolType => s_poolType;
public override string ToString() => InvariantString.Format("{0}({1}, Key={2})", this.GetType().Name, Action, _character);
public override string ToString() => InvariantString.Format("{0}({1}, Key={2})", GetType().Name, Action, _character);
}
}
+4 -4
View File
@@ -31,14 +31,14 @@ namespace Microsoft.Iris.Input
private void Initialize(KeyAction action, InputDeviceType deviceType, CommandCode command)
{
this._command = command;
this.Initialize(action, action == KeyAction.Down ? InputEventType.CommandDown : InputEventType.CommandUp, deviceType);
_command = command;
Initialize(action, action == KeyAction.Down ? InputEventType.CommandDown : InputEventType.CommandUp, deviceType);
}
public CommandCode Command => this._command;
public CommandCode Command => _command;
protected override InputInfo.InfoType PoolType => s_poolType;
public override string ToString() => InvariantString.Format("{0}({1}, Command={2})", this.GetType().Name, Action, _command);
public override string ToString() => InvariantString.Format("{0}({1}, Command={2})", GetType().Name, Action, _command);
}
}
+8 -8
View File
@@ -31,23 +31,23 @@ namespace Microsoft.Iris.Input
private void Initialize(bool state, ICookedInputSite other, KeyFocusReason focusReason)
{
this._state = state;
this._other = other;
this._focusReason = focusReason;
this.Initialize(state ? InputEventType.GainKeyFocus : InputEventType.LoseKeyFocus);
_state = state;
_other = other;
_focusReason = focusReason;
Initialize(state ? InputEventType.GainKeyFocus : InputEventType.LoseKeyFocus);
}
protected override void Zombie()
{
base.Zombie();
this._other = null;
_other = null;
}
public bool State => this._state;
public bool State => _state;
public ICookedInputSite Other => this._other;
public ICookedInputSite Other => _other;
public KeyFocusReason FocusReason => this._focusReason;
public KeyFocusReason FocusReason => _focusReason;
protected override InputInfo.InfoType PoolType => s_poolType;
}
+6 -6
View File
@@ -46,18 +46,18 @@ namespace Microsoft.Iris.Input
int scanCode,
ushort eventFlags)
{
this._key = key;
this.Initialize(action, action == KeyAction.Down ? InputEventType.KeyDown : InputEventType.KeyUp, deviceType, modifiers, repeatCount, systemKey, nativeMessageID, scanCode, eventFlags);
_key = key;
Initialize(action, action == KeyAction.Down ? InputEventType.KeyDown : InputEventType.KeyUp, deviceType, modifiers, repeatCount, systemKey, nativeMessageID, scanCode, eventFlags);
}
public bool IsRepeatOf(KeyStateInfo other) => other != null && this._key == other._key && this.IsRepeatOf((KeyActionInfo)other);
public bool IsRepeatOf(KeyStateInfo other) => other != null && _key == other._key && IsRepeatOf((KeyActionInfo)other);
public KeyStateInfo MakeRepeatableCopy() => Create(this.Action, this.DeviceType, this.Modifiers, this.RepeatCount, this._key, this.SystemKey, this.NativeMessageID, this.ScanCode, this.KeyboardFlags);
public KeyStateInfo MakeRepeatableCopy() => Create(Action, DeviceType, Modifiers, RepeatCount, _key, SystemKey, NativeMessageID, ScanCode, KeyboardFlags);
public Keys Key => this._key;
public Keys Key => _key;
protected override InputInfo.InfoType PoolType => s_poolType;
public override string ToString() => InvariantString.Format("{0}({1}, Key={2})", this.GetType().Name, Action, _key);
public override string ToString() => InvariantString.Format("{0}({1}, Key={2})", GetType().Name, Action, _key);
}
}
+49 -49
View File
@@ -24,38 +24,38 @@ namespace Microsoft.Iris.Input
public KeyboardDevice(InputManager manager)
: base(manager)
{
this._keyStates = new ExpandableArray(4);
this.Reset();
_keyStates = new ExpandableArray(4);
Reset();
}
public InputModifiers KeyboardModifiers
{
get
{
if (this._modifiersDirty)
this.UpdateModifierState();
return this._keyModifiers & InputModifiers.AllKeys;
if (_modifiersDirty)
UpdateModifierState();
return _keyModifiers & InputModifiers.AllKeys;
}
}
public bool Alt => (this.KeyboardModifiers & InputModifiers.AltKey) != InputModifiers.None;
public bool Alt => (KeyboardModifiers & InputModifiers.AltKey) != InputModifiers.None;
public bool Ctrl => (this.KeyboardModifiers & InputModifiers.ControlKey) != InputModifiers.None;
public bool Ctrl => (KeyboardModifiers & InputModifiers.ControlKey) != InputModifiers.None;
public bool Shift => (this.KeyboardModifiers & InputModifiers.ShiftKey) != InputModifiers.None;
public bool Shift => (KeyboardModifiers & InputModifiers.ShiftKey) != InputModifiers.None;
public bool Win => (this.KeyboardModifiers & InputModifiers.WindowsKey) != InputModifiers.None;
public bool Win => (KeyboardModifiers & InputModifiers.WindowsKey) != InputModifiers.None;
internal KeyInfo OnRawInput(
uint message,
InputModifiers modifiers,
ref RawKeyboardData args)
{
this.Manager.HACK_UpdateSystemModifiers(modifiers);
return message == 2U || message == 5U ? this.OnRawKeyCharacter(message, ref args) : this.OnRawKeyState(message, modifiers, ref args);
Manager.HACK_UpdateSystemModifiers(modifiers);
return message == 2U || message == 5U ? OnRawKeyCharacter(message, ref args) : OnRawKeyState(message, modifiers, ref args);
}
internal KeyInfo OnRawKeyCharacter(uint message, ref RawKeyboardData args) => KeyCharacterInfo.Create(KeyAction.Character, args._deviceType, this.Manager.Modifiers, args._repCount, (char)args._virtualKey, message == 5U, message, args._scanCode, args._flags);
internal KeyInfo OnRawKeyCharacter(uint message, ref RawKeyboardData args) => KeyCharacterInfo.Create(KeyAction.Character, args._deviceType, Manager.Modifiers, args._repCount, (char)args._virtualKey, message == 5U, message, args._scanCode, args._flags);
internal KeyInfo OnRawKeyState(
uint message,
@@ -82,9 +82,9 @@ namespace Microsoft.Iris.Input
default:
return null;
}
if (this.TrackKey(action, args._virtualKey, args._scanCode))
if (TrackKey(action, args._virtualKey, args._scanCode))
{
InputModifiers modifiers = this.Manager.Modifiers & ~this.MapKeyToModifier(args._virtualKey);
InputModifiers modifiers = Manager.Modifiers & ~MapKeyToModifier(args._virtualKey);
keyStateInfo = KeyStateInfo.Create(action, args._deviceType, modifiers, args._repCount, args._virtualKey, systemKey, message, args._scanCode, args._flags);
}
return keyStateInfo;
@@ -92,7 +92,7 @@ namespace Microsoft.Iris.Input
public bool IsKeyDown(Keys key)
{
foreach (KeyboardDevice.KeyState keyState in this._keyStates)
foreach (KeyboardDevice.KeyState keyState in _keyStates)
{
if (keyState.VKey == key && keyState.IsDown)
return true;
@@ -102,7 +102,7 @@ namespace Microsoft.Iris.Input
public bool IsKeyHandled(Keys key)
{
foreach (KeyboardDevice.KeyState keyState in this._keyStates)
foreach (KeyboardDevice.KeyState keyState in _keyStates)
{
if (keyState.VKey == key)
return keyState.IsHandled;
@@ -112,7 +112,7 @@ namespace Microsoft.Iris.Input
internal void MarkKeyHandled(Keys key)
{
foreach (KeyboardDevice.KeyState keyState in this._keyStates)
foreach (KeyboardDevice.KeyState keyState in _keyStates)
{
if (keyState.VKey == key && keyState.IsDown)
{
@@ -124,9 +124,9 @@ namespace Microsoft.Iris.Input
public void Reset()
{
this._keyStates.Clear();
this._modifiersDirty = true;
this._keyModifiers = InputModifiers.None;
_keyStates.Clear();
_modifiersDirty = true;
_keyModifiers = InputModifiers.None;
}
private bool TrackKey(KeyAction action, Keys vkey, int scanCode)
@@ -134,15 +134,15 @@ namespace Microsoft.Iris.Input
bool flag = false;
if (vkey == Keys.None)
return false;
if (this.IsModifier(vkey))
this.MarkModifiersInvalid();
if (IsModifier(vkey))
MarkModifiersInvalid();
switch (action)
{
case KeyAction.Up:
flag = this.TrackKeyUp(vkey, scanCode);
flag = TrackKeyUp(vkey, scanCode);
break;
case KeyAction.Down:
flag = this.TrackKeyDown(vkey, scanCode);
flag = TrackKeyDown(vkey, scanCode);
break;
}
return flag;
@@ -151,9 +151,9 @@ namespace Microsoft.Iris.Input
private bool TrackKeyDown(Keys vkey, int scanCode)
{
KeyboardDevice.KeyState keyState1 = null;
for (int index = 0; index < this._keyStates.Length; ++index)
for (int index = 0; index < _keyStates.Length; ++index)
{
KeyboardDevice.KeyState keyState2 = (KeyboardDevice.KeyState)this._keyStates[index];
KeyboardDevice.KeyState keyState2 = (KeyboardDevice.KeyState)_keyStates[index];
if (keyState2 != null)
{
if (keyState2.IsDown)
@@ -166,7 +166,7 @@ namespace Microsoft.Iris.Input
}
else
{
this._keyStates[index] = null;
_keyStates[index] = null;
keyState2.Dispose();
}
}
@@ -174,7 +174,7 @@ namespace Microsoft.Iris.Input
if (keyState1 == null)
{
KeyboardDevice.KeyState keyState2 = new KeyboardDevice.KeyState(vkey, scanCode);
this._keyStates.Add(keyState2);
_keyStates.Add(keyState2);
keyState2.IsDown = true;
}
return true;
@@ -184,7 +184,7 @@ namespace Microsoft.Iris.Input
{
KeyboardDevice.KeyState keyState1 = null;
bool flag = false;
foreach (KeyboardDevice.KeyState keyState2 in this._keyStates)
foreach (KeyboardDevice.KeyState keyState2 in _keyStates)
{
if (keyState2.VKey == vkey && keyState2.ScanCode == scanCode)
{
@@ -201,9 +201,9 @@ namespace Microsoft.Iris.Input
return flag;
}
private bool IsModifier(Keys vkey) => this.MapKeyToModifier(vkey) != InputModifiers.None;
private bool IsModifier(Keys vkey) => MapKeyToModifier(vkey) != InputModifiers.None;
private void MarkModifiersInvalid() => this._modifiersDirty = true;
private void MarkModifiersInvalid() => _modifiersDirty = true;
private InputModifiers MapKeyToModifier(Keys vkey)
{
@@ -231,15 +231,15 @@ namespace Microsoft.Iris.Input
private void UpdateModifierState()
{
if (!this._modifiersDirty)
if (!_modifiersDirty)
return;
this._keyModifiers = InputModifiers.None;
foreach (KeyboardDevice.KeyState keyState in this._keyStates)
_keyModifiers = InputModifiers.None;
foreach (KeyboardDevice.KeyState keyState in _keyStates)
{
if (keyState.IsDown)
this._keyModifiers |= this.MapKeyToModifier(keyState.VKey);
_keyModifiers |= MapKeyToModifier(keyState.VKey);
}
this._modifiersDirty = false;
_modifiersDirty = false;
}
private class KeyState
@@ -251,35 +251,35 @@ namespace Microsoft.Iris.Input
public KeyState(Keys vkey, int scanCode)
{
this._vkey = vkey;
this._scanCode = scanCode;
this._down = false;
this._handled = false;
_vkey = vkey;
_scanCode = scanCode;
_down = false;
_handled = false;
}
public void Dispose() => this.Dispose(true);
public void Dispose() => Dispose(true);
protected void Dispose(bool inDispose)
{
if (!inDispose)
return;
this._vkey = Keys.None;
this._scanCode = -1;
_vkey = Keys.None;
_scanCode = -1;
}
public Keys VKey => this._vkey;
public Keys VKey => _vkey;
public int ScanCode => this._scanCode;
public int ScanCode => _scanCode;
public bool IsDown
{
get => this._down;
set => this._down = value;
get => _down;
set => _down = value;
}
public bool IsHandled => this._handled;
public bool IsHandled => _handled;
public void MarkHandled() => this._handled = true;
public void MarkHandled() => _handled = true;
}
}
}
+20 -20
View File
@@ -30,43 +30,43 @@ namespace Microsoft.Iris.Input
MouseButtons button,
int wheelDelta)
{
this._naturalHit = rawNatural;
this._modifiers = modifiers;
this._screenX = screenX;
this._screenY = screenY;
this._wheelDelta = wheelDelta;
this._nativeMessageID = messageID;
this._button = button;
this.Initialize(rawSource, x, y, eventType);
_naturalHit = rawNatural;
_modifiers = modifiers;
_screenX = screenX;
_screenY = screenY;
_wheelDelta = wheelDelta;
_nativeMessageID = messageID;
_button = button;
Initialize(rawSource, x, y, eventType);
}
protected override void Zombie()
{
base.Zombie();
this._naturalHit = null;
this._naturalTarget = null;
_naturalHit = null;
_naturalTarget = null;
}
public uint NativeMessageID => this._nativeMessageID;
public uint NativeMessageID => _nativeMessageID;
public IRawInputSite NaturalHit => this._naturalHit;
public IRawInputSite NaturalHit => _naturalHit;
public ICookedInputSite NaturalTarget => this._naturalTarget;
public ICookedInputSite NaturalTarget => _naturalTarget;
public InputModifiers Modifiers => this._modifiers;
public InputModifiers Modifiers => _modifiers;
public MouseButtons Button => this._button;
public MouseButtons Button => _button;
public int ScreenX => this._screenX;
public int ScreenX => _screenX;
public int ScreenY => this._screenY;
public int ScreenY => _screenY;
public int WheelDelta => this._wheelDelta;
public int WheelDelta => _wheelDelta;
public void SetMappedTargets(ICookedInputSite target, ICookedInputSite naturalTarget)
{
this.UpdateTarget(target);
this._naturalTarget = naturalTarget;
UpdateTarget(target);
_naturalTarget = naturalTarget;
}
}
}
+7 -7
View File
@@ -49,17 +49,17 @@ namespace Microsoft.Iris.Input
bool state,
uint messageID)
{
this._state = state;
this._doubleClick = false;
this.Initialize(rawSource, rawNatural, x, y, screenX, screenY, modifiers, EventTypeForMouseButton(state, button, modifiers), messageID, button, 0);
_state = state;
_doubleClick = false;
Initialize(rawSource, rawNatural, x, y, screenX, screenY, modifiers, EventTypeForMouseButton(state, button, modifiers), messageID, button, 0);
}
public override InputEventType EventType => this._doubleClick ? InputEventType.MouseDoubleClick : this._eventType;
public override InputEventType EventType => _doubleClick ? InputEventType.MouseDoubleClick : _eventType;
public override void UpdateTarget(ICookedInputSite target)
{
base.UpdateTarget(target);
this._doubleClick = (this.Modifiers & InputModifiers.DoubleClick) != InputModifiers.None && target != null && target.AllowDoubleClicks;
_doubleClick = (Modifiers & InputModifiers.DoubleClick) != InputModifiers.None && target != null && target.AllowDoubleClicks;
}
private static InputEventType EventTypeForMouseButton(
@@ -71,10 +71,10 @@ namespace Microsoft.Iris.Input
return !state ? (!flag ? InputEventType.MouseSecondaryUp : InputEventType.MousePrimaryUp) : (!flag ? InputEventType.MouseSecondaryDown : InputEventType.MousePrimaryDown);
}
public bool IsDown => this._state;
public bool IsDown => _state;
protected override InputInfo.InfoType PoolType => s_poolType;
public override string ToString() => InvariantString.Format("{0}({1}, Button={2})", this.GetType().Name, this._state ? "Down" : "Up", Button);
public override string ToString() => InvariantString.Format("{0}({1}, Button={2})", GetType().Name, _state ? "Down" : "Up", Button);
}
}
+10 -10
View File
@@ -31,13 +31,13 @@ namespace Microsoft.Iris.Input
{
}
public InputModifiers MouseModifiers => this.Manager.HACK_SystemModifiers & InputModifiers.AllMouse;
public InputModifiers MouseModifiers => Manager.HACK_SystemModifiers & InputModifiers.AllMouse;
public bool OnRawInput(uint message, InputModifiers modifiers, ref RawMouseData args)
{
IRawInputSite visCapture = args._visCapture;
IRawInputSite visNatural = args._visNatural;
this.Manager.HACK_UpdateSystemModifiers(modifiers);
Manager.HACK_UpdateSystemModifiers(modifiers);
switch (message)
{
case 512:
@@ -53,11 +53,11 @@ namespace Microsoft.Iris.Input
case 523:
case 524:
case 525:
this.Manager.MostRecentPhysicalMousePos = new Point(args._physicalX, args._physicalY);
this.Manager.Queue.RawMouseMove(visCapture, visNatural, this.Manager.Modifiers, ref args);
Manager.MostRecentPhysicalMousePos = new Point(args._physicalX, args._physicalY);
Manager.Queue.RawMouseMove(visCapture, visNatural, Manager.Modifiers, ref args);
break;
case 675:
this.Manager.Queue.RawMouseLeave();
Manager.Queue.RawMouseLeave();
break;
}
bool state = false;
@@ -77,10 +77,10 @@ namespace Microsoft.Iris.Input
case 517:
case 520:
case 524:
this.Manager.Queue.RawMouseButtonState(message, visCapture, visNatural, this.Manager.Modifiers, args._button, state);
Manager.Queue.RawMouseButtonState(message, visCapture, visNatural, Manager.Modifiers, args._button, state);
break;
case 522:
this.Manager.Queue.RawMouseWheel(this.Manager.Modifiers, ref args);
Manager.Queue.RawMouseWheel(Manager.Modifiers, ref args);
break;
}
return true;
@@ -92,11 +92,11 @@ namespace Microsoft.Iris.Input
ref RawDragData args,
object data)
{
this.Manager.HACK_UpdateSystemModifiers(modifiers);
this.Manager.MostRecentPhysicalMousePos = new Point(args._positionX, args._positionY);
Manager.HACK_UpdateSystemModifiers(modifiers);
Manager.MostRecentPhysicalMousePos = new Point(args._positionX, args._positionY);
IRawInputSite visCapture = args._visCapture;
DragOperation formOperation = (DragOperation)message;
this.Manager.Queue.RawDragDrop(visCapture, data, args._positionX, args._positionY, modifiers, formOperation, args);
Manager.Queue.RawDragDrop(visCapture, data, args._positionX, args._positionY, modifiers, formOperation, args);
return true;
}
}
+6 -6
View File
@@ -37,20 +37,20 @@ namespace Microsoft.Iris.Input
bool state,
ICookedInputSite other)
{
this._state = state;
this._other = other;
this.Initialize(rawSource, x, y, state ? InputEventType.GainMouseFocus : InputEventType.LoseMouseFocus);
_state = state;
_other = other;
Initialize(rawSource, x, y, state ? InputEventType.GainMouseFocus : InputEventType.LoseMouseFocus);
}
protected override void Zombie()
{
base.Zombie();
this._other = null;
_other = null;
}
public ICookedInputSite Other => this._other;
public ICookedInputSite Other => _other;
public bool State => this._state;
public bool State => _state;
protected override InputInfo.InfoType PoolType => s_poolType;
}
+8 -8
View File
@@ -14,22 +14,22 @@ namespace Microsoft.Iris.Input
protected void Initialize(IRawInputSite rawSource, int x, int y, InputEventType eventType)
{
this._rawSource = rawSource;
this._x = x;
this._y = y;
this.Initialize(eventType);
_rawSource = rawSource;
_x = x;
_y = y;
Initialize(eventType);
}
protected override void Zombie()
{
base.Zombie();
this._rawSource = null;
_rawSource = null;
}
public IRawInputSite RawSource => this._rawSource;
public IRawInputSite RawSource => _rawSource;
public int X => this._x;
public int X => _x;
public int Y => this._y;
public int Y => _y;
}
}
+1 -1
View File
@@ -34,7 +34,7 @@ namespace Microsoft.Iris.Input
return mouseWheelInfo;
}
public override string ToString() => InvariantString.Format("{0}(Delta={1})", this.GetType().Name, WheelDelta);
public override string ToString() => InvariantString.Format("{0}(Delta={1})", GetType().Name, WheelDelta);
protected override InputInfo.InfoType PoolType => s_poolType;
}