InjectedInputMouseInfo.MouseData Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets a value used by other properties (see MouseOptions).
public:
property unsigned int MouseData { unsigned int get(); void set(unsigned int value); };
uint32_t MouseData();
void MouseData(uint32_t value);
public uint MouseData { get; set; }
var uInt32 = injectedInputMouseInfo.mouseData;
injectedInputMouseInfo.mouseData = uInt32;
Public Property MouseData As UInteger
Property Value
The value used by other properties.
Examples
Here are some downloadable samples demonstrating basic input and input injection:
Remarks
Important
The APIs in this namespace require the inputInjectionBrokered restricted capability to be declared in the application manifest. For more information on app capability requirements, see App capability declarations.
To use the input injection APIs, open the Package.appxmanifest file and add the following (the rescap
namespace hosts the restricted capabilities, whuch lets you declare the inputInjectionBrokered
capability in the Capabilities
section).
- To
<Package>
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" IgnorableNamespaces="rescap"
- In
<Capabilities>
<rescap:Capability Name="inputInjectionBrokered" />
The value being set is dependent on the MouseOptions flags specified. Some examples include:
- HWheel: the distance that a mouse wheel has rotated around the x-axis (horizontal). The mouse wheel button has discrete, evenly spaced notches or distance thresholds (also called detents). When you rotate or tilt the wheel, a wheel message is sent as each detent is encountered.
The windows constant, WHEEL_DELTA (defined as a value of 120), describes one detent. Each detent marks the threshold for a single increment of an associated action (for example, scrolling a line or page).
Note
The delta was set to 120 to enable finer-resolution wheels (such as freely-rotating wheels with no notches) that send more messages per rotation, but with smaller values per message.
A positive value indicates that the wheel was rotated forward (away from the user) or tilted to the right; a negative value indicates that the wheel was rotated backward (toward the user) or tilted to the left.
Note
MouseData is of type uint
, which doesn't support negative values. You must use an unchecked block or a temporary local variable (see InjectedInputMouseInfo for an example).
- XDown or XUp: 1 for XBUTTON1 or 2 for XBUTTON2XBUTTON1 and XBUTTON2 are additional buttons used on many mouse devices, often for forward and backward navigation in Web browsers. They return the same data as standard mouse buttons.