/*	XModifiers.h
 *
 *		This defines the bits which are used to pass the modifier
 *	keys to the XGView::DoMouseXXX() events and the keyboard events
 */

/**********************************************************************

  YAAF is Copyright 1997-1999 by William Woody.

  Redistribution and use in source and binary forms, with or without 
  modification, are permitted provided that the following conditions 
  are met:

  Redistributions of source code must retain the above copyright notice, 
  this list of conditions and the following disclaimer.

  Neither the name of the copyright holder or other contributors may
  be used to promote products derived from this software without
  specific written prior permission.

  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 
  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 
  OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 
  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 
  BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 
  ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 
  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 
  SOFTWARE.
  
  Contact:   woody@alumni.caltech.edu
  Web page:  http://www.pandawave.com/yaaf/

**********************************************************************/

#ifndef PandaWave_XMODIFIERS
#define PandaWave_XMODIFIERS

/**@name Modifier Flags
 *
 *		These are the modifier flags used by various parts of the YAAF
 *	engine for determining which option keys are currently down for
 *	the particular mouse or key event.
 */
 
//@{

#include <XConfig.h>

/************************************************************************/
/*																		*/
/*	Constants															*/
/*																		*/
/************************************************************************/

/*
 *	Keyboard modifier arguments
 */

/// The shift key is currently down. [Mac, Windows, X]
#define KKeyShift				0x0001

/// The control key is currently down. [Mac, Windows, X]
#define KKeyControl				0x0002

#if OPT_MACOS == 1
/// The Apple (command) key is currently down. [Mac, X is first modifier key]
#	define KKeyCommand			0x0004

/// The Option key is currently down. [Mac. X is second modifier, Windows is Alt key]
#	define KKeyOption			0x0008

/// a drag event is a copy if (modifiers & KKeyDragCopyMask) == KKeyDragCopy
#	define KKeyDragCopyMask		KKeyOption
#	define KKeyDragCopy			KKeyOption

#endif

#if OPT_WINOS == 1
/// The Windows 'Alt' key is currently down. [Windows. Mac is 'Option', X is second modifier]
#	define KKeyMenu				0x0008

/// a drag event is a copy if (modifiers & KKeyDragCopyMask) == KKeyDragCopy
#	define KKeyDragCopyMask		KKeyControl
#	define KKeyDragCopy			KKeyControl

#endif

#if OPT_XWIN == 1
/// The first X modifier key is down. [on Mac, this is the Apple (command) key]
#	define KKeyMod1				0x0004

/// The second X modifier key is down. [on Mac, this is option, on Windows, Alt key]
#	define KKeyMod2				0x0008

/// The third X modifier key.
#	define KKeyMod3				0x0200

/// The fourth X modifier key.
#	define KKeyMod4				0x0400

/// The fifth X modifier key.
#	define KKeyMod5				0x0800
#endif

/// The mouse button key is down. (On Windows, the left button. On X, "Button 1" or left button)
#define	KKeyButton				0x0010

#if OPT_WINOS == 1
/// The right mouse button is down. (No Mac equivalent. Same as X "Button 2")
#	define KKeyRButton			0x0020

/// The middle mouse button is down. (No Mac equivalent. Not on all Windows machines. Same as X "Button 3")
#	define KKeyMButton			0x0040
#endif

#if OPT_XWIN == 1
/// Mouse button 2 down. (On Windows, left button. No equivalent on Mac)
#	define KKeyButton2			0x0020

/// Mouse button 3 down. (On Windows, middle button. No equivalent on Mac.)
#	define KKeyButton3			0x0040

/// Mouse button 4 down. (No equivalent on Mac or Windows, not on all X mice)
#	define KKeyButton4			0x0080

/// Mouse button 5 down. (No equivalent on Mac or Windows, not on all X mice)
#	define KKeyButton5			0x0100
#endif

/// If DoMouseDown() message, this indicates the button was double-clicked.
#define KDoubleClick			0x1000

/// If mouse message, indicates the mouse is "captured"; that is, that DoMouseDown returned 'true' to capture mouse
#define KCapturedMouse			0x2000

/// On DoMouseUp(), indicates the mouse was quickly clicked without dragging
#define KFastClick				0x4000

/// On keyboard processing events, this indicates the key code was a special key, such as an F key.
#define KSpecialKey				0x8000

//@}

#endif // PandaWave_XMODIFIERS
