1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-20 04:09:16 +00:00

Initial Commit of CyanWorlds.com Engine Open Source Client/Plugin

This commit is contained in:
JWPlatt
2011-03-12 12:34:52 -05:00
commit a20a222fc2
3976 changed files with 1301355 additions and 0 deletions

View File

@ -0,0 +1,133 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#ifndef plControlDefinition_inc
#define plControlDefinition_inc
#include "plControlEventCodes.h"
#include "plKeyDef.h"
#include "hsGeometry3.h"
// flags for control event codes
enum
{
kControlFlagNormal = 0x00000001,
kControlFlagNoRepeat = 0x00000002,
kControlFlagDownEvent = 0x00000004,
kControlFlagUpEvent = 0x00000008,
kControlFlagToggle = 0x00000010,
kControlFlagXAxisEvent = 0x00000020,
kControlFlagYAxisEvent = 0x00000040,
kControlFlagRangePos = 0x00000080,
kControlFlagRangeNeg = 0x00000100,
// = 0x00000200,
// = 0x00000400,
kControlFlagConsoleCommand = 0x00000800,
kControlFlagLeftButton = 0x00001000,
kControlFlagRightButton = 0x00002000,
kControlFlagLeftButtonEx = 0x00004000,
kControlFlagRightButtonEx = 0x00008000,
kControlFlagBoxDisable = 0x00010000,
kControlFlagInBox = 0x00020000,
kControlFlagCapsLock = 0x00040000,
kControlFlagNetPropagate = 0x00080000, // Not supported anymore, but save the flag.
kControlFlagLeftButtonUp = 0x00100000,
kControlFlagRightButtonUp = 0x00200000,
kControlFlagRightButtonRepeat = 0x00400000,
kControlFlagLeftButtonRepeat = 0x00800000,
kControlFlagNoDeactivate = 0x01000000,
kControlFlagDelta = 0x02000000,
kControlFlagMiddleButton = 0x04000000,
kControlFlagMiddleButtonEx = 0x08000000,
kControlFlagMiddleButtonRepeat = 0x10000000,
kControlFlagMiddleButtonUp = 0x20000000,
};
// mouse button flags
enum
{
kLeftButtonDown = 0x0001,
kLeftButtonUp = 0x0002,
kRightButtonDown = 0x0004,
kRightButtonUp = 0x0008,
kMiddleButtonDown = 0x0010,
kMiddleButtonUp = 0x0020,
kWheelPos = 0x0040,
kWheelNeg = 0x0080,
KWheelButtonDown = 0x0100,
kWheelButtonUp = 0x0200,
kLeftButtonRepeat = 0x0400,
kRightButtonRepeat = 0x0800,
kMiddleButtonRepeat = 0x1000,
kLeftButtonDblClk = 0x2000,
kRightButtonDblClk = 0x4000,
kAnyButtonDown = kLeftButtonDown | kRightButtonDown | kMiddleButtonDown,
};
// mouse cursor flags
enum
{
kMouseNormal = 0x0000,
kMouseClickable = 0x0001,
};
struct Win32keyConvert
{
UInt32 fVKey;
char* fKeyName;
};
struct CommandConvert
{
ControlEventCode fCode;
char* fDesc;
};
struct plMouseInfo
{
plMouseInfo(ControlEventCode _code, UInt32 _flags, hsPoint4 _box, char* _desc)
{
fCode = _code;
fControlFlags = _flags;
fBox = _box;
fControlDescription = _desc;
}
plMouseInfo(ControlEventCode _code, UInt32 _flags, hsScalar pt1, hsScalar pt2, hsScalar pt3, hsScalar pt4, char* _desc)
{
fCode = _code;
fControlFlags = _flags;
fBox.Set(pt1,pt2,pt3,pt4);
fControlDescription = _desc;
}
ControlEventCode fCode;
UInt32 fControlFlags;
hsPoint4 fBox;
char* fControlDescription;
};
#endif // plControlDefinition_inc

View File

@ -0,0 +1,146 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#ifndef plControlEventCodes_inc
#define plControlEventCodes_inc
// list of all controls that could potentially
// be mapped to a key, a mouse button, etc
// NOTE:
// NOTE:
// NOTE: PLEASE READ BEFORE MODIFYING THIS FILE!!!!!!!!!!!!!!!!!!!
// NOTE:
// NOTE:
// Please put new control key events at the end of this enum (just before END_CONTROLS).
// This way the corresponding Python constants will match more often
// and cause much less stress on game play programmers who's telescopes stop working
// Thanks!
enum ControlEventCode
{
// button controls
B_CONTROL_ACTION = 0,
B_CONTROL_ACTION_MOUSE,
B_CONTROL_JUMP,
B_CONTROL_MOVE_FORWARD,
B_CONTROL_MOVE_BACKWARD,
B_CONTROL_STRAFE_LEFT,
B_CONTROL_STRAFE_RIGHT,
B_CONTROL_MOVE_UP,
B_CONTROL_MOVE_DOWN,
B_CONTROL_ROTATE_LEFT,
B_CONTROL_ROTATE_RIGHT,
B_CONTROL_ROTATE_UP,
B_CONTROL_ROTATE_DOWN,
B_CONTROL_MODIFIER_FAST,
B_CONTROL_ALWAYS_RUN, // This is no longer a bindable key. It is hard-coded to caps-lock
B_CONTROL_EQUIP,
B_CONTROL_DROP,
B_CONTROL_TURN_TO,
B_TOGGLE_DRIVE_MODE,
B_CAMERA_MOVE_FORWARD,
B_CAMERA_MOVE_BACKWARD,
B_CAMERA_MOVE_UP,
B_CAMERA_MOVE_DOWN,
B_CAMERA_MOVE_LEFT,
B_CAMERA_MOVE_RIGHT,
B_CAMERA_PAN_UP,
B_CAMERA_PAN_DOWN,
B_CAMERA_PAN_LEFT,
B_CAMERA_PAN_RIGHT,
B_CAMERA_MOVE_FAST,
B_CAMERA_ROTATE_RIGHT,
B_CAMERA_ROTATE_LEFT,
B_CAMERA_ROTATE_UP,
B_CAMERA_ROTATE_DOWN,
B_CAMERA_RECENTER,
B_CAMERA_DRIVE_SPEED_UP,
B_CAMERA_DRIVE_SPEED_DOWN,
B_CAMERA_ZOOM_IN,
B_CAMERA_ZOOM_OUT,
B_SET_CONSOLE_MODE,
B_CONTROL_CONSOLE_COMMAND,
B_CONTROL_TOGGLE_PHYSICAL,
B_CONTROL_PICK,
// axis controls
A_CONTROL_MOVE,
A_CONTROL_TURN,
A_CONTROL_MOUSE_X,
A_CONTROL_MOUSE_Y,
// special controls
S_SET_CURSOR_UP,
S_SET_CURSOR_DOWN,
S_SET_CURSOR_RIGHT,
S_SET_CURSOR_LEFT,
S_SET_CURSOR_POISED,
S_SET_CURSOR_HIDDEN,
S_SET_CURSOR_UNHIDDEN,
S_SET_CURSOR_ARROW,
S_SEARCH_FOR_PICKABLE,
S_INCREASE_MIC_VOL,
S_DECREASE_MIC_VOL,
S_PUSH_TO_TALK,
S_SET_THIRD_PERSON_MODE,
S_SET_FIRST_PERSON_MODE,
S_SET_WALK_MODE,
S_SET_FREELOOK,
S_SET_CONSOLE_SINGLE,
S_SET_CONSOLE_HIDDEN,
// Inventory controls
dead__B_CONTROL_SET_EQUIPED_STATE,
dead__B_CONTROL_SCROLL_UP_LIST,
dead__B_CONTROL_SCROLL_DOWN_LIST,
dead__B_CONTROL_SET_INVENTORY_ACTIVE,
dead__B_CONTROL_SET_INVENTORY_DISACTIVE,
dead__B_CONTROL_REMOVE_INV_OBJECT,
dead__B_CONTROL_ENABLE_OBJECT,
// Avatar emote controls
B_CONTROL_EMOTE,
B_CONTROL_EXIT_MODE,
// new controls key events
B_CONTROL_DIVE,
B_CAMERA_PAN_TO_CURSOR,
B_CONTROL_OPEN_KI,
B_CONTROL_OPEN_BOOK,
B_CONTROL_EXIT_GUI_MODE,
B_CONTROL_MODIFIER_STRAFE,
B_CONTROL_CAMERA_WALK_PAN,
S_SET_BASIC_MODE, // Opposite of walk mode
B_CONTROL_IGNORE_AVATARS, //anti-griefing thing
B_CONTROL_LADDER_INVERTED, // used by ladders to invert forward/backward
B_CONTROL_CONSUMABLE_JUMP, // used to limit the avatar to one jump per keypress
S_SET_WALK_BACK_MODE,
S_SET_WALK_BACK_LB_MODE,
S_SET_CURSOR_UPWARD,
S_SET_LADDER_CONTROL,
S_CLEAR_LADDER_CONTROL,
END_CONTROLS
};
#endif // plControlEventCodes_inc

View File

@ -0,0 +1,51 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
// plInputDevice.h
#ifndef PL_INPUT_MAP_H
#define PL_INPUT_MAP_H
#include "hsTypes.h"
#include "plControlDefinition.h"
#include "hsTemplates.h"
class plInputMap
{
public:
static CommandConvert fCmdConvert[];
static ControlEventCode ConvertCharToControlCode(const char* c);
static const char *ConvertControlCodeToString( ControlEventCode code );
};
class plMouseMap : public plInputMap
{
public:
~plMouseMap();
hsTArray<plMouseInfo*> fMap;
int AddMapping(plMouseInfo* pNfo);
};
#endif // PL_INPUT_DEVICE_H

View File

@ -0,0 +1,157 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#ifndef plKeyDef_inc
#define plKeyDef_inc
#include "hsConfig.h"
#if HS_BUILD_FOR_WIN32
#include "windows.h"
#define VK_BACK_QUOTE 0xc0
//
// keyboard definitions:
//
// map O.S. specific keyboard defines
// to plasma key defines here...
//
//
// for win32:
enum plKeyDef
{
KEY_A = 'A',
KEY_B = 'B',
KEY_C = 'C',
KEY_D = 'D',
KEY_E = 'E',
KEY_F = 'F',
KEY_G = 'G',
KEY_H = 'H',
KEY_I = 'I',
KEY_J = 'J',
KEY_K = 'K',
KEY_L = 'L',
KEY_M = 'M',
KEY_N = 'N',
KEY_O = 'O',
KEY_P = 'P',
KEY_Q = 'Q',
KEY_R = 'R',
KEY_S = 'S',
KEY_T = 'T',
KEY_U = 'U',
KEY_V = 'V',
KEY_W = 'W',
KEY_X = 'X',
KEY_Y = 'Y',
KEY_Z = 'Z',
KEY_0 = 0x30,
KEY_1 = 0x31,
KEY_2 = 0x32,
KEY_3 = 0x33,
KEY_4 = 0x34,
KEY_5 = 0x35,
KEY_6 = 0x36,
KEY_7 = 0x37,
KEY_8 = 0x38,
KEY_9 = 0x39,
KEY_F1 = VK_F1,
KEY_F2 = VK_F2,
KEY_F3 = VK_F3,
KEY_F4 = VK_F4,
KEY_F5 = VK_F5,
KEY_F6 = VK_F6,
KEY_F7 = VK_F7,
KEY_F8 = VK_F8,
KEY_F9 = VK_F9,
KEY_F10 = VK_F10,
KEY_F11 = VK_F11,
KEY_F12 = VK_F12,
KEY_ESCAPE = VK_ESCAPE,
KEY_TAB = VK_TAB,
KEY_SHIFT = VK_SHIFT,
KEY_CTRL = VK_CONTROL,
KEY_ALT = VK_MENU,
KEY_UP = VK_UP,
KEY_DOWN = VK_DOWN,
KEY_LEFT = VK_LEFT,
KEY_RIGHT = VK_RIGHT,
KEY_BACKSPACE = VK_BACK,
KEY_ENTER = VK_RETURN,
KEY_PAUSE = VK_PAUSE,
KEY_CAPSLOCK = VK_CAPITAL,
KEY_PAGEUP = VK_PRIOR,
KEY_PAGEDOWN = VK_NEXT,
KEY_END = VK_END,
KEY_HOME = VK_HOME,
KEY_PRINTSCREEN = VK_SNAPSHOT,
KEY_INSERT = VK_INSERT,
KEY_DELETE = VK_DELETE,
KEY_NUMPAD0 = VK_NUMPAD0,
KEY_NUMPAD1 = VK_NUMPAD1,
KEY_NUMPAD2 = VK_NUMPAD2,
KEY_NUMPAD3 = VK_NUMPAD3,
KEY_NUMPAD4 = VK_NUMPAD4,
KEY_NUMPAD5 = VK_NUMPAD5,
KEY_NUMPAD6 = VK_NUMPAD6,
KEY_NUMPAD7 = VK_NUMPAD7,
KEY_NUMPAD8 = VK_NUMPAD8,
KEY_NUMPAD9 = VK_NUMPAD9,
KEY_NUMPAD_MULTIPLY = VK_MULTIPLY,
KEY_NUMPAD_ADD = VK_ADD,
KEY_NUMPAD_SUBTRACT = VK_SUBTRACT,
KEY_NUMPAD_PERIOD = VK_DECIMAL,
KEY_NUMPAD_DIVIDE = VK_DIVIDE,
KEY_SPACE = VK_SPACE,
KEY_COMMA = VK_OEM_COMMA,
KEY_PERIOD = VK_OEM_PERIOD,
KEY_DASH = VK_OEM_MINUS,
KEY_EQUAL = VK_OEM_PLUS,
// these are only good in the US of A...
KEY_SEMICOLON = VK_OEM_1,
KEY_SLASH = VK_OEM_2,
KEY_TILDE = VK_OEM_3,
KEY_LBRACKET = VK_OEM_4,
KEY_BACKSLASH = VK_OEM_5,
KEY_RBRACKET = VK_OEM_6,
KEY_QUOTE = VK_OEM_7,
KEY_UNMAPPED = 0xffffffff,
};
#elif HS_BUILD_FOR_UNIX
enum plKeyDef
{
KEY_UNMAPPED = 0xffffffff,
};
#endif
#endif // plKeyDef_inc

View File

@ -0,0 +1,223 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
//////////////////////////////////////////////////////////////////////////////
//
// plKeyMap - Generic class that defines a mapping of 1-or-2 key codes to
// ControlEventCodes
//
//////////////////////////////////////////////////////////////////////////////
#ifndef _plKeyMap_h
#define _plKeyMap_h
#include "hsTypes.h"
#include "plInputMap.h"
#include "plControlEventCodes.h"
#include "hsTemplates.h"
//// plKeyCombo //////////////////////////////////////////////////////////////
// Tiny class/data type representing a single key combo. Ex. shift+C
class plKeyCombo
{
public:
plKeyDef fKey;
UInt8 fFlags;
// The ordering of this lets us treat the flags as a priority number.
// kCtrl + kShift > kCtrl > kShift > no flags
enum Flags
{
kShift = 0x01,
kCtrl = 0x02
};
static plKeyCombo kUnmapped;
plKeyCombo();
plKeyCombo( plKeyDef k, UInt8 flags = 0 ) : fKey( k ), fFlags( flags ) { }
hsBool IsSatisfiedBy(const plKeyCombo &combo) const;
hsBool operator==( const plKeyCombo &rhs ) const { return ( fKey == rhs.fKey ) && ( fFlags == rhs.fFlags ); }
hsBool operator!=( const plKeyCombo &rhs ) const { return ( fKey != rhs.fKey ) || ( fFlags != rhs.fFlags ); }
};
//// For the Particularly Lazy... ////////////////////////////////////////////
class plShiftKeyCombo : public plKeyCombo
{
public:
plShiftKeyCombo( plKeyDef k ) : plKeyCombo( k, kShift ) {}
};
class plCtrlKeyCombo : public plKeyCombo
{
public:
plCtrlKeyCombo( plKeyDef k ) : plKeyCombo( k, kCtrl ) {}
};
class plCtrlShiftKeyCombo : public plKeyCombo
{
public:
plCtrlShiftKeyCombo( plKeyDef k ) : plKeyCombo( k, kCtrl | kShift ) {}
};
//// plKeyBinding ////////////////////////////////////////////////////////////
// Record for a single binding of 1-or-2 keys to a ControlEventCode, with
// optional string if necessary (for, say console command bindings)
class plKeyBinding
{
protected:
ControlEventCode fCode;
UInt32 fCodeFlags; // Needed?
plKeyCombo fKey1; // KEY_UNMAPPED for not-used
plKeyCombo fKey2;
char *fString;
public:
plKeyBinding();
plKeyBinding( ControlEventCode code, UInt32 codeFlags, const plKeyCombo &key1, const plKeyCombo &key2, const char *string = nil );
virtual ~plKeyBinding();
ControlEventCode GetCode( void ) const { return fCode; }
UInt32 GetCodeFlags( void ) const { return fCodeFlags; }
const plKeyCombo &GetKey1( void ) const { return fKey1; }
const plKeyCombo &GetKey2( void ) const { return fKey2; }
const char *GetExtendedString( void ) const { return fString; }
const plKeyCombo &GetMatchingKey( plKeyDef keyDef ) const;
void SetKey1( const plKeyCombo &newCombo );
void SetKey2( const plKeyCombo &newCombo );
void ClearKeys( void );
hsBool HasUnmappedKey() const;
};
//// plKeyMap ////////////////////////////////////////////////////////////////
// Basically an array of plKeyBindings with some extra helpers
class plKeyMap : public plInputMap
{
public:
// Konstants for the bind preference
enum BindPref
{
kNoPreference = 0, // Just bind to any free one, else first
kNoPreference2nd, // Bind to a free one, or second key if no free one
kFirstAlways, // Bind to first key no matter what
kSecondAlways // Ditto but for 2nd key
};
protected:
hsTArray<plKeyBinding *> fBindings;
plKeyBinding *IFindBindingByKey( const plKeyCombo &combo ) const;
void IFindAllBindingsByKey( const plKeyCombo &combo, hsTArray<plKeyBinding*> &result ) const;
plKeyBinding *IFindBinding( ControlEventCode code ) const;
plKeyBinding *IFindConsoleBinding( const char *command ) const;
void IActuallyBind( plKeyBinding *binding, const plKeyCombo &combo, BindPref pref );
void ICheckAndBindDupe( plKeyDef origKey, plKeyDef dupeKey );
public:
plKeyMap();
virtual ~plKeyMap();
// Adds a given control code to the map. Once you add it, you can't change its flags. Returns false if the code is already present
hsBool AddCode( ControlEventCode code, UInt32 codeFlags );
// Same but for console commands. No flags b/c console commands always use the same flags
hsBool AddConsoleCommand( const char *command );
// Adds a key binding to a given code. Returns false if the code isn't in this map or if key is already mapped.
hsBool BindKey( const plKeyCombo &combo, ControlEventCode code, BindPref pref = kNoPreference );
// Console command version
hsBool BindKeyToConsoleCmd( const plKeyCombo &combo, const char *command, BindPref pref = kNoPreference );
// Searches for the binding for a given code. Returns nil if not found
const plKeyBinding *FindBinding( ControlEventCode code ) const;
// Searches for the binding by key. Returns nil if not found
const plKeyBinding *FindBindingByKey( const plKeyCombo &combo ) const;
// Finds multiple bindings (when there are unneeded ctrl/shift flags)
void FindAllBindingsByKey( const plKeyCombo &combo, hsTArray<const plKeyBinding*> &result ) const;
// Searches for the binding by console command. Returns nil if not found
const plKeyBinding* plKeyMap::FindConsoleBinding( const char *command ) const;
// Make sure the given keys are clear of bindings, i.e. not used
void EnsureKeysClear( const plKeyCombo &key1, const plKeyCombo &key2 );
// Unmaps the given key, no matter what binding it is in
void UnmapKey( const plKeyCombo &combo );
// Unmaps the keys for a single binding
void UnmapBinding( ControlEventCode code );
// Unmaps all the bindings, but leaves the code records themselves
void UnmapAllBindings( void );
// Erases the given code binding. Note: should never really be used, but provided here for completeness
void EraseBinding( ControlEventCode code );
// Clears ALL bindings
void ClearAll( void );
static const char* GetStringCtrl();
static const char* GetStringShift();
static const char* GetStringUnmapped();
UInt32 GetNumBindings( void ) const { return fBindings.GetCount(); }
const plKeyBinding &GetBinding( UInt32 i ) const { return *fBindings[ i ]; }
void HandleAutoDualBinding( plKeyDef key1, plKeyDef key2 );
static char *ConvertVKeyToChar( UInt32 vk );
static plKeyDef ConvertCharToVKey( const char *c );
static Win32keyConvert fKeyConversionEnglish[];
static Win32keyConvert fKeyConversionFrench[];
static Win32keyConvert fKeyConversionGerman[];
//static Win32keyConvert fKeyConversionSpanish[];
//static Win32keyConvert fKeyConversionItalian[];
};
#endif // _plKeyMap_h

View File

@ -0,0 +1,78 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#ifndef plOSMsg_inc
#define plOSMsg_inc
#include <windows.h>
//
// This enum wraps all of the OS messages
// that we care about for this particular
// platform - add as necessary...
//
// for Win32:
enum plOSMsg
{
KEYDOWN = WM_KEYDOWN,
KEYUP = WM_KEYUP,
MOUSEMOVE = WM_MOUSEMOVE,
L_BUTTONDN = WM_LBUTTONDOWN,
L_BUTTONUP = WM_LBUTTONUP,
R_BUTTONDN = WM_RBUTTONDOWN,
R_BUTTONUP = WM_RBUTTONUP,
MOUSEWHEEL = 0x020A,
L_BUTTONDBLCLK = WM_LBUTTONDBLCLK,
R_BUTTONDBLCLK = WM_RBUTTONDBLCLK,
SYSKEYDOWN = WM_SYSKEYDOWN,
SYSKEYUP = WM_SYSKEYUP,
M_BUTTONDN = WM_MBUTTONDOWN,
M_BUTTONUP = WM_MBUTTONUP,
};
//
// generic structure that we can use to describe
// the state of the mouse on any platform.
//
//
struct plMouseState
{
enum
{
kLeftButton = 0x0001,
kRightButton = 0x0002,
kMiddleButton = 0x0004,
};
float fX;
float fY;
UInt32 fButtonState;
};
#endif // plOSMsg