mirror of https://github.com/dahall/Vanara.git
Moved MouseButtonState from User32 to Shared assembly and up to PInvoke namespace. Fixed dependencies.
parent
2066523bd0
commit
f0fd3f0334
|
@ -0,0 +1,31 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Vanara.PInvoke
|
||||||
|
{
|
||||||
|
/// <summary>The state of the other mouse buttons plus the SHIFT and CTRL keys.</summary>
|
||||||
|
[PInvokeData("winuser.h")]
|
||||||
|
[Flags]
|
||||||
|
public enum MouseButtonState
|
||||||
|
{
|
||||||
|
/// <summary>The left mouse button is down.</summary>
|
||||||
|
MK_LBUTTON = 0x0001,
|
||||||
|
|
||||||
|
/// <summary>The right mouse button is down.</summary>
|
||||||
|
MK_RBUTTON = 0x0002,
|
||||||
|
|
||||||
|
/// <summary>The SHIFT key is down.</summary>
|
||||||
|
MK_SHIFT = 0x0004,
|
||||||
|
|
||||||
|
/// <summary>The CTRL key is down.</summary>
|
||||||
|
MK_CONTROL = 0x0008,
|
||||||
|
|
||||||
|
/// <summary>The middle mouse button is down.</summary>
|
||||||
|
MK_MBUTTON = 0x0010,
|
||||||
|
|
||||||
|
/// <summary>The XBUTTON1 button is down.</summary>
|
||||||
|
MK_XBUTTON1 = 0x0020,
|
||||||
|
|
||||||
|
/// <summary>The XBUTTON2 button is down.</summary>
|
||||||
|
MK_XBUTTON2 = 0x0040,
|
||||||
|
}
|
||||||
|
}
|
|
@ -72,7 +72,7 @@ namespace Vanara.PInvoke
|
||||||
// https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-iexecutecommand-setkeystate HRESULT
|
// https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-iexecutecommand-setkeystate HRESULT
|
||||||
// SetKeyState( DWORD grfKeyState );
|
// SetKeyState( DWORD grfKeyState );
|
||||||
[PreserveSig]
|
[PreserveSig]
|
||||||
HRESULT SetKeyState(User32.MouseButtonState grfKeyState);
|
HRESULT SetKeyState(MouseButtonState grfKeyState);
|
||||||
|
|
||||||
/// <summary>Provides parameter values for the verb.</summary>
|
/// <summary>Provides parameter values for the verb.</summary>
|
||||||
/// <param name="pszParameters">
|
/// <param name="pszParameters">
|
||||||
|
|
|
@ -19,33 +19,6 @@ namespace Vanara.PInvoke
|
||||||
GMMP_USE_HIGH_RESOLUTION_POINTS = 2,
|
GMMP_USE_HIGH_RESOLUTION_POINTS = 2,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>The state of the other mouse buttons plus the SHIFT and CTRL keys.</summary>
|
|
||||||
[PInvokeData("winuser.h")]
|
|
||||||
[Flags]
|
|
||||||
public enum MouseButtonState
|
|
||||||
{
|
|
||||||
/// <summary>The left mouse button is down.</summary>
|
|
||||||
MK_LBUTTON = 0x0001,
|
|
||||||
|
|
||||||
/// <summary>The right mouse button is down.</summary>
|
|
||||||
MK_RBUTTON = 0x0002,
|
|
||||||
|
|
||||||
/// <summary>The SHIFT key is down.</summary>
|
|
||||||
MK_SHIFT = 0x0004,
|
|
||||||
|
|
||||||
/// <summary>The CTRL key is down.</summary>
|
|
||||||
MK_CONTROL = 0x0008,
|
|
||||||
|
|
||||||
/// <summary>The middle mouse button is down.</summary>
|
|
||||||
MK_MBUTTON = 0x0010,
|
|
||||||
|
|
||||||
/// <summary>The XBUTTON1 button is down.</summary>
|
|
||||||
MK_XBUTTON1 = 0x0020,
|
|
||||||
|
|
||||||
/// <summary>The XBUTTON2 button is down.</summary>
|
|
||||||
MK_XBUTTON2 = 0x0040,
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>Controls various aspects of mouse motion and button clicking.</summary>
|
/// <summary>Controls various aspects of mouse motion and button clicking.</summary>
|
||||||
[PInvokeData("winuser.h", MSDNShortId = "")]
|
[PInvokeData("winuser.h", MSDNShortId = "")]
|
||||||
[Flags]
|
[Flags]
|
||||||
|
|
|
@ -88,7 +88,7 @@ namespace Vanara.Windows.Shell
|
||||||
|
|
||||||
/// <summary>Gets a value based on the current state of the keys CTRL and SHIFT.</summary>
|
/// <summary>Gets a value based on the current state of the keys CTRL and SHIFT.</summary>
|
||||||
/// <value>The value based on the current state of the keys CTRL and SHIFT.</value>
|
/// <value>The value based on the current state of the keys CTRL and SHIFT.</value>
|
||||||
public User32.MouseButtonState KeyState { get; private set; }
|
public MouseButtonState KeyState { get; private set; }
|
||||||
|
|
||||||
/// <summary>Gets a new working directory. This value is <see langword="null"/> if the current working directory is to be used.</summary>
|
/// <summary>Gets a new working directory. This value is <see langword="null"/> if the current working directory is to be used.</summary>
|
||||||
/// <value>Returns a <see cref="string"/> value.</value>
|
/// <value>Returns a <see cref="string"/> value.</value>
|
||||||
|
@ -149,7 +149,7 @@ namespace Vanara.Windows.Shell
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
HRESULT IExecuteCommand.SetKeyState(User32.MouseButtonState grfKeyState)
|
HRESULT IExecuteCommand.SetKeyState(MouseButtonState grfKeyState)
|
||||||
{
|
{
|
||||||
KeyState = grfKeyState;
|
KeyState = grfKeyState;
|
||||||
return HRESULT.S_OK;
|
return HRESULT.S_OK;
|
||||||
|
|
Loading…
Reference in New Issue