Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
fengzch-das
OIS
Commits
01314637
Commit
01314637
authored
Oct 06, 2013
by
Ben Hymers
Browse files
Removed all trailing whitespace
parent
b408932f
Changes
94
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
233 additions
and
233 deletions
+233
-233
includes/mac/MacHIDManager.h
includes/mac/MacHIDManager.h
+14
-14
includes/mac/MacHelpers.h
includes/mac/MacHelpers.h
+25
-25
includes/mac/MacInputManager.h
includes/mac/MacInputManager.h
+23
-23
includes/mac/MacJoyStick.h
includes/mac/MacJoyStick.h
+22
-22
includes/mac/MacKeyboard.h
includes/mac/MacKeyboard.h
+32
-32
includes/mac/MacMouse.h
includes/mac/MacMouse.h
+6
-6
includes/mac/MacPrereqs.h
includes/mac/MacPrereqs.h
+14
-14
includes/win32/Win32ForceFeedback.h
includes/win32/Win32ForceFeedback.h
+8
-8
includes/win32/Win32InputManager.h
includes/win32/Win32InputManager.h
+7
-7
includes/win32/Win32JoyStick.h
includes/win32/Win32JoyStick.h
+9
-9
includes/win32/Win32KeyBoard.h
includes/win32/Win32KeyBoard.h
+9
-9
includes/win32/Win32Mouse.h
includes/win32/Win32Mouse.h
+6
-6
includes/win32/Win32Prereqs.h
includes/win32/Win32Prereqs.h
+5
-5
src/OISEffect.cpp
src/OISEffect.cpp
+16
-16
src/OISForceFeedback.cpp
src/OISForceFeedback.cpp
+6
-6
src/OISInputManager.cpp
src/OISInputManager.cpp
+7
-7
src/OISJoyStick.cpp
src/OISJoyStick.cpp
+5
-5
src/SDL/SDLInputManager.cpp
src/SDL/SDLInputManager.cpp
+7
-7
src/SDL/SDLKeyboard.cpp
src/SDL/SDLKeyboard.cpp
+6
-6
src/SDL/SDLMouse.cpp
src/SDL/SDLMouse.cpp
+6
-6
No files found.
includes/mac/MacHIDManager.h
View file @
01314637
/*
The zlib/libpng License
Copyright (c) 2007 Phillip
This software is provided 'as-is', without any express or implied warranty. In no event will
the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial
Permission is granted to anyone to use this software for any purpose, including commercial
applications, and to alter it and redistribute it freely, subject to the following
restrictions:
1. The origin of this software must not be misrepresented; you must not claim that
you wrote the original software. If you use this software in a product,
an acknowledgment in the product documentation would be appreciated but is
1. The origin of this software must not be misrepresented; you must not claim that
you wrote the original software. If you use this software in a product,
an acknowledgment in the product documentation would be appreciated but is
not required.
2. Altered source versions must be plainly marked as such, and must not be
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#ifndef OIS_MacHIDManager_Header
...
...
@@ -61,7 +61,7 @@ namespace OIS
};
typedef
std
::
vector
<
HidInfo
*>
HidInfoList
;
class
MacHIDManager
:
public
FactoryCreator
{
public:
...
...
@@ -69,7 +69,7 @@ namespace OIS
~
MacHIDManager
();
void
initialize
();
void
iterateAndOpenDevices
(
io_iterator_t
iterator
);
io_iterator_t
lookUpDevices
(
int
usage
,
int
page
);
...
...
@@ -97,7 +97,7 @@ namespace OIS
void
parseDeviceProperties
(
CFDictionaryRef
properties
);
void
parseDevicePropertiesGroup
(
CFDictionaryRef
properties
);
HidInfoList
mDeviceList
;
HidInfoList
mDeviceList
;
};
}
#endif
includes/mac/MacHelpers.h
View file @
01314637
/*
The zlib/libpng License
Copyright (c) 2006 Chris Snyder
Copyright (c) 2006 Chris Snyder
This software is provided 'as-is', without any express or implied warranty. In no event will
the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial
Permission is granted to anyone to use this software for any purpose, including commercial
applications, and to alter it and redistribute it freely, subject to the following
restrictions:
1. The origin of this software must not be misrepresented; you must not claim that
you wrote the original software. If you use this software in a product,
an acknowledgment in the product documentation would be appreciated but is
1. The origin of this software must not be misrepresented; you must not claim that
you wrote the original software. If you use this software in a product,
an acknowledgment in the product documentation would be appreciated but is
not required.
2. Altered source versions must be plainly marked as such, and must not be
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#ifndef OIS_MacHelpers_H
...
...
@@ -30,7 +30,7 @@
#include <Carbon/Carbon.h>
// This is a hack needed to get the event handler working.
// This is a hack needed to get the event handler working.
// The carbon lib expects a "OSStatus (*)(EventHandlerCallRef, EventRef, void*)",
// so I cannot give it a class member function (unless it is static which is pointless)
// Instead, I just pass the class* through the last paramter that gets passed to the
...
...
@@ -47,7 +47,7 @@ OSStatus MouseWrapper( EventHandlerCallRef nextHandler, EventRef theEvent, void*
// This is needed for keeping an event stack for keyboard and mouse
namespace
OIS
{
// used in the eventStack to store the type
enum
Mac_EventType
{
MAC_KEYUP
=
0
,
MAC_KEYDOWN
=
1
,
...
...
@@ -57,37 +57,37 @@ namespace OIS
MAC_MOUSEMOVED
,
MAC_MOUSESCROLL
};
typedef
enum
Mac_EventType
MacEventType
;
// only used by MacKeyboard
typedef
class
Mac_KeyStackEvent
{
friend
class
MacKeyboard
;
private:
Mac_KeyStackEvent
(
KeyEvent
event
,
MacEventType
type
)
:
Event
(
event
),
Type
(
type
)
{}
MacEventType
Type
;
KeyEvent
Event
;
}
MacKeyStackEvent
;
// only used by MacMouse
typedef
class
Mac_MouseStackEvent
{
friend
class
MacMouse
;
private:
Mac_MouseStackEvent
(
MouseEvent
event
,
MacEventType
type
,
MouseButtonID
button
)
:
Event
(
event
),
Type
(
type
),
Button
(
button
)
{}
MacEventType
Type
;
MouseEvent
Event
;
MouseButtonID
Button
;
}
MacMouseStackEvent
;
}
...
...
includes/mac/MacInputManager.h
View file @
01314637
/*
The zlib/libpng License
Copyright (c) 2006 Chris Snyder
Copyright (c) 2006 Chris Snyder
This software is provided 'as-is', without any express or implied warranty. In no event will
the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial
Permission is granted to anyone to use this software for any purpose, including commercial
applications, and to alter it and redistribute it freely, subject to the following
restrictions:
1. The origin of this software must not be misrepresented; you must not claim that
you wrote the original software. If you use this software in a product,
an acknowledgment in the product documentation would be appreciated but is
1. The origin of this software must not be misrepresented; you must not claim that
you wrote the original software. If you use this software in a product,
an acknowledgment in the product documentation would be appreciated but is
not required.
2. Altered source versions must be plainly marked as such, and must not be
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#ifndef OIS_MacInputManager_H
...
...
@@ -30,13 +30,13 @@
namespace
OIS
{
class
MacInputManager
:
public
InputManager
,
public
FactoryCreator
{
public:
MacInputManager
();
virtual
~
MacInputManager
();
//InputManager Overrides
/** @copydoc InputManager::_initialize */
void
_initialize
(
ParamList
&
paramList
);
...
...
@@ -66,24 +66,24 @@ namespace OIS
//! Internal method, used for flaggin mouse as available/unavailable for creation
void
_setMouseUsed
(
bool
used
)
{
mouseUsed
=
used
;
}
//! methodfor getting the event target
EventTargetRef
_getEventTarget
()
{
return
mEventTargetRef
;}
//! method for getting window
WindowRef
_getWindow
()
{
return
mWindow
;}
protected:
protected:
void
_parseConfigSettings
(
ParamList
&
paramList
);
void
_enumerateDevices
();
static
const
std
::
string
iName
;
// Mac stuff
EventTargetRef
mEventTargetRef
;
WindowRef
mWindow
;
// settings
bool
mHideMouse
;
bool
mUseRepeat
;
...
...
@@ -93,7 +93,7 @@ namespace OIS
//! Used to know if we used up mouse
bool
mouseUsed
;
//! HID Manager class handling devices other than keyboard/mouse
MacHIDManager
*
mHIDManager
;
};
...
...
includes/mac/MacJoyStick.h
View file @
01314637
/*
The zlib/libpng License
Copyright (c) 2005-2007 Phillip Castaneda (pjcast -- www.wreckedgames.com)
This software is provided 'as-is', without any express or implied warranty. In no event will
the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial
applications, and to alter it and redistribute it freely, subject to the following
restrictions:
1. The origin of this software must not be misrepresented; you must not claim that
you wrote the original software. If you use this software in a product,
an acknowledgment in the product documentation would be appreciated but is
not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#ifndef MAC_Joystick_H
...
...
@@ -32,40 +32,40 @@ namespace OIS
{
int
min
;
int
max
;
AxisInfo
(
int
min
,
int
max
)
:
min
(
min
),
max
(
max
)
{}
};
typedef
struct
cookie_struct
{
std
::
map
<
IOHIDElementCookie
,
AxisInfo
>
axisCookies
;
std
::
vector
<
IOHIDElementCookie
>
buttonCookies
;
}
cookie_struct_t
;
typedef
struct
cookie_struct
{
std
::
map
<
IOHIDElementCookie
,
AxisInfo
>
axisCookies
;
std
::
vector
<
IOHIDElementCookie
>
buttonCookies
;
}
cookie_struct_t
;
//class HidDeviceInfo
class
MacJoyStick
:
public
JoyStick
{
public:
MacJoyStick
(
const
std
::
string
&
vendor
,
bool
buffered
,
HidInfo
*
info
,
InputManager
*
creator
,
int
devID
);
virtual
~
MacJoyStick
();
/** @copydoc Object::setBuffered */
virtual
void
setBuffered
(
bool
buffered
);
/** @copydoc Object::capture */
virtual
void
capture
();
/** @copydoc Object::queryInterface */
virtual
Interface
*
queryInterface
(
Interface
::
IType
type
);
/** @copydoc Object::_initialize */
virtual
void
_initialize
();
void
_enumerateCookies
();
IOHIDQueueInterface
**
_createQueue
(
unsigned
int
depth
=
8
);
protected:
HidInfo
*
mInfo
;
...
...
includes/mac/MacKeyboard.h
View file @
01314637
/*
The zlib/libpng License
Copyright (c) 2006 Chris Snyder
Copyright (c) 2006 Chris Snyder
This software is provided 'as-is', without any express or implied warranty. In no event will
the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial
Permission is granted to anyone to use this software for any purpose, including commercial
applications, and to alter it and redistribute it freely, subject to the following
restrictions:
1. The origin of this software must not be misrepresented; you must not claim that
you wrote the original software. If you use this software in a product,
an acknowledgment in the product documentation would be appreciated but is
1. The origin of this software must not be misrepresented; you must not claim that
you wrote the original software. If you use this software in a product,
an acknowledgment in the product documentation would be appreciated but is
not required.
2. Altered source versions must be plainly marked as such, and must not be
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#ifndef OIS_MacKeyboard_H
...
...
@@ -31,72 +31,72 @@
namespace
OIS
{
class
MacKeyboard
:
public
Keyboard
{
public:
MacKeyboard
(
InputManager
*
creator
,
bool
buffered
,
bool
repeat
);
virtual
~
MacKeyboard
();
// Sets buffered mode
virtual
void
setBuffered
(
bool
buffered
);
// unbuffered keydown check
virtual
bool
isKeyDown
(
KeyCode
key
)
const
;
// This will send listener events if buffered is on.
// Note that in the mac implementation, unbuffered input is
// automatically updated without calling this.
virtual
void
capture
();
// Copies the current key buffer
virtual
void
copyKeyStates
(
char
keys
[
256
]
)
const
;
// Returns a description of the given key
virtual
std
::
string
&
getAsString
(
KeyCode
key
);
virtual
Interface
*
queryInterface
(
Interface
::
IType
type
)
{
return
0
;
}
// Public but reserved for internal use:
virtual
void
_initialize
();
void
_keyDownCallback
(
EventRef
theEvent
);
void
_keyUpCallback
(
EventRef
theEvent
);
void
_modChangeCallback
(
EventRef
theEvent
);
protected:
// just to get this out of the way
void
populateKeyConversion
();
// updates the keybuffer and optionally the eventStack
void
injectEvent
(
KeyCode
kc
,
unsigned
int
time
,
MacEventType
type
,
unsigned
int
txt
=
0
);
typedef
std
::
map
<
UInt32
,
KeyCode
>
VirtualtoOIS_KeyMap
;
VirtualtoOIS_KeyMap
keyConversion
;
std
::
string
getString
;
char
KeyBuffer
[
256
];
UInt32
prevModMask
;
// "universal procedure pointers" - required reference for callbacks
EventHandlerUPP
keyDownUPP
;
EventHandlerUPP
keyUpUPP
;
EventHandlerUPP
keyModUPP
;
// so we can delete the handlers on destruction
EventHandlerRef
keyDownEventRef
;
EventHandlerRef
keyUpEventRef
;
EventHandlerRef
keyModEventRef
;
// buffered events, fifo stack
typedef
std
::
list
<
MacKeyStackEvent
>
eventStack
;
eventStack
pendingEvents
;
bool
useRepeat
;
};
}
#endif
includes/mac/MacMouse.h
View file @
01314637
...
...
@@ -14,7 +14,7 @@ namespace OIS
public:
MacMouse
(
InputManager
*
creator
,
bool
buffered
);
virtual
~
MacMouse
();
/** @copydoc Object::setBuffered */
virtual
void
setBuffered
(
bool
buffered
);
...
...
@@ -26,23 +26,23 @@ namespace OIS
/** @copydoc Object::_initialize */
virtual
void
_initialize
();
public:
void
_mouseCallback
(
EventRef
theEvent
);
protected:
static
OSStatus
WindowFocusChanged
(
EventHandlerCallRef
nextHandler
,
EventRef
event
,
void
*
macMouse
);
// "universal procedure pointers" - required reference for callbacks
EventHandlerUPP
mouseUPP
;
EventHandlerRef
mouseEventRef
;
EventHandlerUPP
mWindowFocusListener
;
EventHandlerRef
mWindowFocusHandler
;
bool
mNeedsToRegainFocus
;
bool
mMouseWarped
;
MouseState
mTempState
;
};
}
...
...
includes/mac/MacPrereqs.h
View file @
01314637
/*
The zlib/libpng License
Copyright (c) 2006 Chris Snyder
Copyright (c) 2006 Chris Snyder
This software is provided 'as-is', without any express or implied warranty. In no event will
the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial
Permission is granted to anyone to use this software for any purpose, including commercial
applications, and to alter it and redistribute it freely, subject to the following
restrictions:
1. The origin of this software must not be misrepresented; you must not claim that
you wrote the original software. If you use this software in a product,
an acknowledgment in the product documentation would be appreciated but is
1. The origin of this software must not be misrepresented; you must not claim that
you wrote the original software. If you use this software in a product,
an acknowledgment in the product documentation would be appreciated but is
not required.
2. Altered source versions must be plainly marked as such, and must not be
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#ifndef OIS_MacPrereqs_H
...
...
@@ -34,7 +34,7 @@ namespace OIS
class
MacMouse
;
class
MacKeyboard
;
/**
/**
Simple wrapper class for CFString which will create a valid CFString and retain ownership until class instance is outof scope
To Access the CFStringRef instance, simply cast to void*, pass into a function expecting a void* CFStringRef object, or access via cf_str() method
*/
...
...
@@ -49,7 +49,7 @@ namespace OIS
//Allow this class to be autoconverted to base class of StringRef (void*)
operator
void
*
()
{
return
(
void
*
)
m_StringRef
;
}
CFStringRef
cf_str
()
{
return
m_StringRef
;
}
private:
CFStringRef
m_StringRef
;
};
...
...
includes/win32/Win32ForceFeedback.h
View file @
01314637
...
...
@@ -6,16 +6,16 @@ Copyright (c) 2005-2007 Phillip Castaneda (pjcast -- www.wreckedgames.com)
This software is provided 'as-is', without any express or implied warranty. In no event will
the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial
Permission is granted to anyone to use this software for any purpose, including commercial
applications, and to alter it and redistribute it freely, subject to the following
restrictions:
1. The origin of this software must not be misrepresented; you must not claim that
you wrote the original software. If you use this software in a product,
an acknowledgment in the product documentation would be appreciated but is
1. The origin of this software must not be misrepresented; you must not claim that
you wrote the original software. If you use this software in a product,
an acknowledgment in the product documentation would be appreciated but is
not required.
2. Altered source versions must be plainly marked as such, and must not be
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
...
...
@@ -47,7 +47,7 @@ namespace OIS
/** @copydoc ForceFeedback::setMasterGain */
void
setMasterGain
(
float
level
);
/** @copydoc ForceFeedback::setAutoCenterMode */
void
setAutoCenterMode
(
bool
auto_on
);
...
...
@@ -82,7 +82,7 @@ namespace OIS
//Sets the common properties to all effects
void
_setCommonProperties
(
DIEFFECT
*
diEffect
,
DWORD
*
rgdwAxes
,
LONG
*
rglDirection
,
DIENVELOPE
*
diEnvelope
,
DWORD
struct_size
,
LONG
*
rglDirection
,
DIENVELOPE
*
diEnvelope
,
DWORD
struct_size
,
LPVOID
struct_type
,
const
Effect
*
effect
,
const
Envelope
*
envelope
);
//Actually do the upload
void
_upload
(
GUID
,
DIEFFECT
*
,
const
Effect
*
);
...
...
@@ -97,7 +97,7 @@ namespace OIS
// Joystick device descriptor.
IDirectInputDevice8
*
mJoyStick
;
// Joystick capabilities.
const
DIDEVCAPS
*
mpDIJoyCaps
;
...
...
includes/win32/Win32InputManager.h
View file @
01314637
...
...
@@ -6,16 +6,16 @@ Copyright (c) 2005-2007 Phillip Castaneda (pjcast -- www.wreckedgames.com)
This software is provided 'as-is', without any express or implied warranty. In no event will
the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial
Permission is granted to anyone to use this software for any purpose, including commercial
applications, and to alter it and redistribute it freely, subject to the following
restrictions:
1. The origin of this software must not be misrepresented; you must not claim that
you wrote the original software. If you use this software in a product,
an acknowledgment in the product documentation would be appreciated but is
1. The origin of this software must not be misrepresented; you must not claim that
you wrote the original software. If you use this software in a product,
an acknowledgment in the product documentation would be appreciated but is
not required.
2. Altered source versions must be plainly marked as such, and must not be
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
...
...
@@ -65,7 +65,7 @@ namespace OIS
//! Internal method, used for flaggin mouse as available/unavailable for creation
void
_setMouseUsed
(
bool
used
)
{
mouseUsed
=
used
;
}
//! Internal method, return unused joystick to queue
void
_returnJoyStick
(
const
JoyStickInfo
&
joystick
);
...
...
@@ -75,7 +75,7 @@ namespace OIS
protected:
//! internal class method for dealing with param list
void
_parseConfigSettings
(
ParamList
&
paramList
);
//! internal class method for finding attached devices
void
_enumerateDevices
();
...
...
includes/win32/Win32JoyStick.h
View file @
01314637
...
...
@@ -6,16 +6,16 @@ Copyright (c) 2005-2007 Phillip Castaneda (pjcast -- www.wreckedgames.com)
This software is provided 'as-is', without any express or implied warranty. In no event will
the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial
Permission is granted to anyone to use this software for any purpose, including commercial
applications, and to alter it and redistribute it freely, subject to the following
restrictions:
1. The origin of this software must not be misrepresented; you must not claim that
you wrote the original software. If you use this software in a product,
an acknowledgment in the product documentation would be appreciated but is
1. The origin of this software must not be misrepresented; you must not claim that
you wrote the original software. If you use this software in a product,
an acknowledgment in the product documentation would be appreciated but is
not required.
2. Altered source versions must be plainly marked as such, and must not be
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
...
...
@@ -33,10 +33,10 @@ namespace OIS
public:
Win32JoyStick
(
InputManager
*
creator
,
IDirectInput8
*
pDI
,
bool
buffered
,
DWORD
coopSettings
,
const
JoyStickInfo
&
info
);
virtual
~
Win32JoyStick
();
/** @copydoc Object::setBuffered */
virtual
void
setBuffered
(
bool
buffered
);
/** @copydoc Object::capture */
virtual
void
capture
();
...
...
@@ -52,9 +52,9 @@ namespace OIS
#ifdef OIS_WIN32_XINPUT_SUPPORT
/**
@remarks
Enum each PNP device using WMI and check each device ID to see if it contains
Enum each PNP device using WMI and check each device ID to see if it contains
"IG_" (ex. "VID_045E&PID_028E&IG_00"). If it does, then it's an XInput device
Unfortunately this information can not be found by just using DirectInput
Unfortunately this information can not be found by just using DirectInput
*/
static
void
CheckXInputDevices
(
JoyStickInfoList
&
joys
);
#endif
...
...
includes/win32/Win32KeyBoard.h
View file @
01314637
...
...
@@ -6,16 +6,16 @@ Copyright (c) 2005-2007 Phillip Castaneda (pjcast -- www.wreckedgames.com)
This software is provided 'as-is', without any express or implied warranty. In no event will
the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial
Permission is granted to anyone to use this software for any purpose, including commercial
applications, and to alter it and redistribute it freely, subject to the following
restrictions:
1. The origin of this software must not be misrepresented; you must not claim that
you wrote the original software. If you use this software in a product,
an acknowledgment in the product documentation would be appreciated but is
1. The origin of this software must not be misrepresented; you must not claim that
you wrote the original software. If you use this software in a product,
an acknowledgment in the product documentation would be appreciated but is
not required.
2. Altered source versions must be plainly marked as such, and must not be
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
...
...
@@ -46,7 +46,7 @@ namespace OIS
/** @copydoc Keyboard::isKeyDown */
virtual
bool
isKeyDown
(
KeyCode
key
)
const
;
/** @copydoc Keyboard::getAsString */
virtual
const
std
::
string
&
getAsString
(
KeyCode
kc
);
...
...
@@ -55,13 +55,13 @@ namespace OIS
/** @copydoc Object::setBuffered */
virtual
void
setBuffered
(
bool
buffered
);
/** @copydoc Object::capture */
virtual
void
capture
();
/** @copydoc Object::queryInterface */
virtual
Interface
*
queryInterface
(
Interface
::
IType
type
)
{
return
0
;}
/** @copydoc Object::_initialize */
virtual
void
_initialize
();
protected:
...
...
@@ -73,7 +73,7 @@ namespace OIS
DWORD
coopSetting
;
unsigned
char
KeyBuffer
[
256
];
//! Internal method for translating KeyCodes to Text
int
_translateText
(
KeyCode
kc
);
...
...
includes/win32/Win32Mouse.h
View file @
01314637
...
...
@@ -6,16 +6,16 @@ Copyright (c) 2005-2007 Phillip Castaneda (pjcast -- www.wreckedgames.com)
This software is provided 'as-is', without any express or implied warranty. In no event will
the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial
Permission is granted to anyone to use this software for any purpose, including commercial
applications, and to alter it and redistribute it freely, subject to the following
restrictions:
1. The origin of this software must not be misrepresented; you must not claim that
you wrote the original software. If you use this software in a product,
an acknowledgment in the product documentation would be appreciated but is
1. The origin of this software must not be misrepresented; you must not claim that
you wrote the original software. If you use this software in a product,
an acknowledgment in the product documentation would be appreciated but is
not required.
2. Altered source versions must be plainly marked as such, and must not be
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
...
...
@@ -33,7 +33,7 @@ namespace OIS
public:
Win32Mouse
(
InputManager
*
creator
,
IDirectInput8
*
pDI
,
bool
buffered
,
DWORD
coopSettings
);
virtual
~
Win32Mouse
();
/** @copydoc Object::setBuffered */
virtual
void
setBuffered
(
bool
buffered
);
...
...
includes/win32/Win32Prereqs.h
View file @
01314637
...
...
@@ -6,16 +6,16 @@ Copyright (c) 2005-2007 Phillip Castaneda (pjcast -- www.wreckedgames.com)
This software is provided 'as-is', without any express or implied warranty. In no event will
the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial
Permission is granted to anyone to use this software for any purpose, including commercial
applications, and to alter it and redistribute it freely, subject to the following
restrictions:
1. The origin of this software must not be misrepresented; you must not claim that
you wrote the original software. If you use this software in a product,
an acknowledgment in the product documentation would be appreciated but is
1. The origin of this software must not be misrepresented; you must not claim that
you wrote the original software. If you use this software in a product,
an acknowledgment in the product documentation would be appreciated but is
not required.
2. Altered source versions must be plainly marked as such, and must not be
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
...
...
src/OISEffect.cpp
View file @
01314637
...
...
@@ -6,16 +6,16 @@ Copyright (c) 2005-2007 Phillip Castaneda (pjcast -- www.wreckedgames.com)
This software is provided 'as-is', without any express or implied warranty. In no event will
the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial
Permission is granted to anyone to use this software for any purpose, including commercial
applications, and to alter it and redistribute it freely, subject to the following
restrictions:
1. The origin of this software must not be misrepresented; you must not claim that
you wrote the original software. If you use this software in a product,
an acknowledgment in the product documentation would be appreciated but is
1. The origin of this software must not be misrepresented; you must not claim that
you wrote the original software. If you use this software in a product,
an acknowledgment in the product documentation would be appreciated but is
not required.
2. Altered source versions must be plainly marked as such, and must not be
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
...
...
@@ -25,17 +25,17 @@ restrictions:
using
namespace
OIS
;
//VC7.1 had a problem with these not getting included..
//VC7.1 had a problem with these not getting included..
//Perhaps a case of a crazy extreme optimizer :/ (moved to header)
//const unsigned int Effect::OIS_INFINITE = 0xFFFFFFFF;
//------------------------------------------------------------------------------//
static
const
char
*
pszEForceString
[]
=
static
const
char
*
pszEForceString
[]
=
{
"UnknownForce"
,
"ConstantForce"
,
"RampForce"
,
"PeriodicForce"
,
"ConditionalForce"
,
"ConstantForce"
,
"RampForce"
,
"PeriodicForce"
,
"ConditionalForce"
,
"CustomForce"
};
const
char
*
Effect
::
getForceTypeName
(
Effect
::
EForce
eValue
)
...
...
@@ -43,7 +43,7 @@ const char* Effect::getForceTypeName(Effect::EForce eValue)
return
(
eValue
>=
0
&&
eValue
<
_ForcesNumber
)
?
pszEForceString
[
eValue
]
:
"<Bad force type>"
;
}
static
const
char
*
pszETypeString
[]
=
static
const
char
*
pszETypeString
[]
=
{
"Unknown"
,
"Constant"
,
"Ramp"
,
...
...
@@ -56,7 +56,7 @@ const char* Effect::getEffectTypeName(Effect::EType eValue)
return
(
eValue
>=
0
&&
eValue
<
_TypesNumber
)
?
pszETypeString
[
eValue
]
:
"<Bad effect type>"
;
}
static
const
char
*
pszEDirectionString
[]
=
static
const
char
*
pszEDirectionString
[]
=
{
"NorthWest"
,
"North"
,
"NorthEast"
,
"East"
,
"SouthEast"
,
"South"
,
"SouthWest"
,
"West"
};
const
char
*
Effect
::
getDirectionName
(
Effect
::
EDirection
eValue
)
...
...
@@ -65,10 +65,10 @@ const char* Effect::getDirectionName(Effect::EDirection eValue)
}
//------------------------------------------------------------------------------//
Effect
::
Effect
(
EForce
ef
,
EType
et
)
:
force
(
ef
),
Effect
::
Effect
(
EForce
ef
,
EType
et
)
:
force
(
ef
),
type
(
et
),
direction
(
North
),
direction
(
North
),
trigger_button
(
-
1
),
trigger_interval
(
0
),
replay_length
(
Effect
::
OIS_INFINITE
),
...
...
src/OISForceFeedback.cpp
View file @
01314637
...
...
@@ -6,16 +6,16 @@ Copyright (c) 2005-2007 Phillip Castaneda (pjcast -- www.wreckedgames.com)
This software is provided 'as-is', without any express or implied warranty. In no event will
the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial
Permission is granted to anyone to use this software for any purpose, including commercial
applications, and to alter it and redistribute it freely, subject to the following
restrictions:
1. The origin of this software must not be misrepresented; you must not claim that
you wrote the original software. If you use this software in a product,
an acknowledgment in the product documentation would be appreciated but is
1. The origin of this software must not be misrepresented; you must not claim that
you wrote the original software. If you use this software in a product,
an acknowledgment in the product documentation would be appreciated but is
not required.
2. Altered source versions must be plainly marked as such, and must not be
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
...
...
@@ -61,7 +61,7 @@ const ForceFeedback::SupportedEffectList& ForceFeedback::getSupportedEffects() c
//-------------------------------------------------------------//
bool
ForceFeedback
::
supportsEffect
(
Effect
::
EForce
force
,
Effect
::
EType
type
)
const
{
const
std
::
pair
<
SupportedEffectList
::
const_iterator
,
SupportedEffectList
::
const_iterator
>
const
std
::
pair
<
SupportedEffectList
::
const_iterator
,
SupportedEffectList
::
const_iterator
>
iterRange
=
mSupportedEffects
.
equal_range
(
force
);
SupportedEffectList
::
const_iterator
iter
;
for
(
iter
=
iterRange
.
first
;
iter
!=
iterRange
.
second
;
iter
++
)
...
...
src/OISInputManager.cpp
View file @
01314637
...
...
@@ -6,16 +6,16 @@ Copyright (c) 2005-2007 Phillip Castaneda (pjcast -- www.wreckedgames.com)
This software is provided 'as-is', without any express or implied warranty. In no event will
the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial
Permission is granted to anyone to use this software for any purpose, including commercial
applications, and to alter it and redistribute it freely, subject to the following
restrictions:
1. The origin of this software must not be misrepresented; you must not claim that
you wrote the original software. If you use this software in a product,
an acknowledgment in the product documentation would be appreciated but is
1. The origin of this software must not be misrepresented; you must not claim that
you wrote the original software. If you use this software in a product,
an acknowledgment in the product documentation would be appreciated but is
not required.
2. Altered source versions must be plainly marked as such, and must not be
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
...
...
@@ -118,7 +118,7 @@ InputManager* InputManager::createInputSystem( ParamList ¶mList )
im
=
new
iPhoneInputManager
();
#else
OIS_EXCEPT
(
E_General
,
"No platform library.. check build platform defines!"
);
#endif
#endif
try
{
...
...
@@ -140,7 +140,7 @@ void InputManager::destroyInputSystem(InputManager* manager)
return
;
//Cleanup before deleting...
for
(
FactoryCreatedObject
::
iterator
i
=
manager
->
mFactoryObjects
.
begin
();
for
(
FactoryCreatedObject
::
iterator
i
=
manager
->
mFactoryObjects
.
begin
();
i
!=
manager
->
mFactoryObjects
.
end
();
++
i
)
{
i
->
second
->
destroyObject
(
i
->
first
);
...
...
src/OISJoyStick.cpp
View file @
01314637
...
...
@@ -6,16 +6,16 @@ Copyright (c) 2005-2007 Phillip Castaneda (pjcast -- www.wreckedgames.com)
This software is provided 'as-is', without any express or implied warranty. In no event will
the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial
Permission is granted to anyone to use this software for any purpose, including commercial
applications, and to alter it and redistribute it freely, subject to the following
restrictions:
1. The origin of this software must not be misrepresented; you must not claim that
you wrote the original software. If you use this software in a product,
an acknowledgment in the product documentation would be appreciated but is
1. The origin of this software must not be misrepresented; you must not claim that
you wrote the original software. If you use this software in a product,
an acknowledgment in the product documentation would be appreciated but is
not required.
2. Altered source versions must be plainly marked as such, and must not be
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
...
...
src/SDL/SDLInputManager.cpp
View file @
01314637
...
...
@@ -6,16 +6,16 @@ Copyright (c) 2005-2007 Phillip Castaneda (pjcast -- www.wreckedgames.com)
This software is provided 'as-is', without any express or implied warranty. In no event will
the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial
Permission is granted to anyone to use this software for any purpose, including commercial
applications, and to alter it and redistribute it freely, subject to the following
restrictions:
1. The origin of this software must not be misrepresented; you must not claim that
you wrote the original software. If you use this software in a product,
an acknowledgment in the product documentation would be appreciated but is
1. The origin of this software must not be misrepresented; you must not claim that
you wrote the original software. If you use this software in a product,
an acknowledgment in the product documentation would be appreciated but is
not required.
2. Altered source versions must be plainly marked as such, and must not be
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
...
...
@@ -85,12 +85,12 @@ int SDLInputManager::numKeyboards()
Object
*
SDLInputManager
::
createInputObject
(
Type
iType
,
bool
bufferMode
)
{
Object
*
obj
=
0
;
switch
(
iType
)
{
case
OISKeyboard
:
obj
=
new
SDLKeyboard
(
bufferMode
);
break
;
case
OISMouse
:
obj
=
new
SDLMouse
(
bufferMode
);
break
;
case
OISJoyStick
:
case
OISJoyStick
:
default:
OIS_EXCEPT
(
E_InputDeviceNotSupported
,
"Type not implemented"
);
}
...
...
src/SDL/SDLKeyboard.cpp
View file @
01314637
...
...
@@ -6,16 +6,16 @@ Copyright (c) 2005-2007 Phillip Castaneda (pjcast -- www.wreckedgames.com)
This software is provided 'as-is', without any express or implied warranty. In no event will
the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial
Permission is granted to anyone to use this software for any purpose, including commercial
applications, and to alter it and redistribute it freely, subject to the following
restrictions:
1. The origin of this software must not be misrepresented; you must not claim that
you wrote the original software. If you use this software in a product,
an acknowledgment in the product documentation would be appreciated but is
1. The origin of this software must not be misrepresented; you must not claim that
you wrote the original software. If you use this software in a product,
an acknowledgment in the product documentation would be appreciated but is
not required.
2. Altered source versions must be plainly marked as such, and must not be
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
...
...
@@ -161,7 +161,7 @@ SDLKeyboard::~SDLKeyboard()
void
SDLKeyboard
::
capture
()
{
SDL_Event
events
[
OIS_SDL_KEY_BUFF
];
int
count
=
SDL_PeepEvents
(
events
,
OIS_SDL_KEY_BUFF
,
SDL_GETEVENT
,
int
count
=
SDL_PeepEvents
(
events
,
OIS_SDL_KEY_BUFF
,
SDL_GETEVENT
,
SDL_EVENTMASK
(
SDL_KEYDOWN
)
|
SDL_EVENTMASK
(
SDL_KEYUP
));
for
(
int
i
=
0
;
i
<
count
;
++
i
)
...
...
src/SDL/SDLMouse.cpp
View file @
01314637
...
...
@@ -6,16 +6,16 @@ Copyright (c) 2005-2007 Phillip Castaneda (pjcast -- www.wreckedgames.com)
This software is provided 'as-is', without any express or implied warranty. In no event will
the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial
Permission is granted to anyone to use this software for any purpose, including commercial
applications, and to alter it and redistribute it freely, subject to the following
restrictions:
1. The origin of this software must not be misrepresented; you must not claim that
you wrote the original software. If you use this software in a product,
an acknowledgment in the product documentation would be appreciated but is
1. The origin of this software must not be misrepresented; you must not claim that
you wrote the original software. If you use this software in a product,
an acknowledgment in the product documentation would be appreciated but is
not required.
2. Altered source versions must be plainly marked as such, and must not be
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
...
...
@@ -74,7 +74,7 @@ void SDLMouse::capture()
{
switch
(
events
[
i
].
type
)
{
case
SDL_MOUSEMOTION
:
mouseXYMoved
=
true
;
break
;
case
SDL_MOUSEMOTION
:
mouseXYMoved
=
true
;
break
;
case
SDL_MOUSEBUTTONDOWN
:
{
mRegainFocus
=
true
;
...
...
Prev
1
2
3
4
5
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment