CSharpUtilities::KeyState Struct Reference


Detailed Description

A first-class object, bit masks and query functions for the DragEventArgs.KeyState and QueryContinueDragEventArgs.KeyState properties as defined in the msdn documentation.

These aren't formalised anywhere in the .NET framework.

List of all members.

Public Types

enum   Mask {
  LeftMouseButton = 1, RightMouseButton = 2, Shift = 4, Ctrl = 8,
  MiddleMouseButton = 16, Alt = 32
}
 

Mask values taken from DragEventArgs.KeyState and QueryContinueDragEventArgs.KeyState properties as specified in the msdn documentation.

More...

Public Member Functions

  KeyState (int keyStateBits)
  Constructor.
override bool  Equals (Object other)
  Determine if this KeyState is equal to another KeyState value.
override int  GetHashCode ()
  Get a hash code for this KeyState value.

Properties

int  Bits [get]
  The encapsulated KeyState bit field.
bool  LeftMousePressed [get]
  Is the left mouse button pressed?
bool  RightMousePressed [get]
  Is the right mouse button pressed?
bool  MiddleMousePressed [get]
  Is the middle mouse button pressed?
bool  ShiftPressed [get]
  Is the Shift key pressed?
bool  CtrlPressed [get]
  Is the Ctrl key pressed?
bool  AltPressed [get]
  Is the Alt key pressed?

Member Enumeration Documentation

Mask values taken from DragEventArgs.KeyState and QueryContinueDragEventArgs.KeyState properties as specified in the msdn documentation.

Enumerator:
LeftMouseButton 

Left mouse button bit field.

RightMouseButton 

Right mouse button bit field.

Shift 

Shift key bit field.

Ctrl 

Ctrl key bit field.

MiddleMouseButton 

Middle mouse button bit field.

Alt 

Alt key bit field.


Constructor & Destructor Documentation

CSharpUtilities::KeyState::KeyState ( int  keyStateBits ) [inline]

Constructor.

Takes the bitfield from DragEventArgs.KeyState or QueryContinueDragEventArgs.KeyState.

Parameters:
keyStateBits The bitfield from DragEventArgs.KeyState or QueryContinueDragEventArgs.KeyState.

Member Function Documentation

override bool CSharpUtilities::KeyState::Equals ( Object  other ) [inline]

Determine if this KeyState is equal to another KeyState value.

Two KeyStates are equal if they have exactly equal Bits.

Parameters:
other The object against which to compare.
Returns:
true if other is a KeyState and has exactly the same Bits as this. false otherwise.
override int CSharpUtilities::KeyState::GetHashCode ( ) [inline]

Get a hash code for this KeyState value.

Returns:
Hash code created from the Bits value.

Property Documentation

int CSharpUtilities::KeyState::Bits [get]

The encapsulated KeyState bit field.

bool CSharpUtilities::KeyState::LeftMousePressed [get]

Is the left mouse button pressed?

bool CSharpUtilities::KeyState::RightMousePressed [get]

Is the right mouse button pressed?

bool CSharpUtilities::KeyState::MiddleMousePressed [get]

Is the middle mouse button pressed?

bool CSharpUtilities::KeyState::ShiftPressed [get]

Is the Shift key pressed?

bool CSharpUtilities::KeyState::CtrlPressed [get]

Is the Ctrl key pressed?

bool CSharpUtilities::KeyState::AltPressed [get]

Is the Alt key pressed?