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
6a6c0c87
Commit
6a6c0c87
authored
Jul 10, 2010
by
Phillip Castaneda
Browse files
Removing extra whitespace
parent
d44381f7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
18 deletions
+18
-18
includes/OISKeyboard.h
includes/OISKeyboard.h
+9
-9
includes/win32/Win32KeyBoard.h
includes/win32/Win32KeyBoard.h
+4
-4
src/win32/Win32KeyBoard.cpp
src/win32/Win32KeyBoard.cpp
+5
-5
No files found.
includes/OISKeyboard.h
View file @
6a6c0c87
...
...
@@ -183,7 +183,7 @@ namespace OIS
class
_OISExport
KeyEvent
:
public
EventArg
{
public:
KeyEvent
(
Object
*
obj
,
KeyCode
kc
,
unsigned
int
txt
)
:
EventArg
(
obj
),
key
(
kc
),
text
(
txt
)
{}
KeyEvent
(
Object
*
obj
,
KeyCode
kc
,
unsigned
int
txt
)
:
EventArg
(
obj
),
key
(
kc
),
text
(
txt
)
{}
virtual
~
KeyEvent
()
{}
//! KeyCode of event
...
...
@@ -200,8 +200,8 @@ namespace OIS
{
public:
virtual
~
KeyListener
()
{}
virtual
bool
keyPressed
(
const
KeyEvent
&
arg
)
=
0
;
virtual
bool
keyReleased
(
const
KeyEvent
&
arg
)
=
0
;
virtual
bool
keyPressed
(
const
KeyEvent
&
arg
)
=
0
;
virtual
bool
keyReleased
(
const
KeyEvent
&
arg
)
=
0
;
};
/**
...
...
@@ -219,7 +219,7 @@ namespace OIS
@param key
A KeyCode to check
*/
virtual
bool
isKeyDown
(
KeyCode
key
)
const
=
0
;
virtual
bool
isKeyDown
(
KeyCode
key
)
const
=
0
;
/**
@remarks
...
...
@@ -228,7 +228,7 @@ namespace OIS
@param keyListener
Send a pointer to a class derived from KeyListener or 0 to clear the callback
*/
virtual
void
setEventCallback
(
KeyListener
*
keyListener
)
{
mListener
=
keyListener
;}
virtual
void
setEventCallback
(
KeyListener
*
keyListener
)
{
mListener
=
keyListener
;}
/**
@remarks
...
...
@@ -253,7 +253,7 @@ namespace OIS
@param mode
Off, Unicode, Ascii
*/
virtual
void
setTextTranslation
(
TextTranslationMode
mode
);
virtual
void
setTextTranslation
(
TextTranslationMode
mode
);
/**
@remarks
...
...
@@ -271,7 +271,7 @@ namespace OIS
@returns
The string as determined from the current locale
*/
virtual
const
std
::
string
&
getAsString
(
KeyCode
kc
)
=
0
;
virtual
const
std
::
string
&
getAsString
(
KeyCode
kc
)
=
0
;
//! Enum of bit position of modifer
enum
Modifier
...
...
@@ -285,14 +285,14 @@ namespace OIS
@remarks
Check modifier status
*/
bool
isModifierDown
(
Modifier
mod
)
const
;
bool
isModifierDown
(
Modifier
mod
)
const
;
/**
@remarks
Copies the state of the keys into the sent buffer
(in the form of 1 is down and 0 is up)
*/
virtual
void
copyKeyStates
(
char
keys
[
256
]
)
const
=
0
;
virtual
void
copyKeyStates
(
char
keys
[
256
])
const
=
0
;
protected:
Keyboard
(
const
std
::
string
&
vendor
,
bool
buffered
,
int
devID
,
InputManager
*
creator
)
...
...
includes/win32/Win32KeyBoard.h
View file @
6a6c0c87
...
...
@@ -41,17 +41,17 @@ namespace OIS
@param coopSettings
A combination of DI Flags (see DX Help for info on input device settings)
*/
Win32Keyboard
(
InputManager
*
creator
,
IDirectInput8
*
pDI
,
bool
buffered
,
DWORD
coopSettings
);
Win32Keyboard
(
InputManager
*
creator
,
IDirectInput8
*
pDI
,
bool
buffered
,
DWORD
coopSettings
);
virtual
~
Win32Keyboard
();
/** @copydoc Keyboard::isKeyDown */
virtual
bool
isKeyDown
(
KeyCode
key
)
const
;
virtual
bool
isKeyDown
(
KeyCode
key
)
const
;
/** @copydoc Keyboard::getAsString */
virtual
const
std
::
string
&
getAsString
(
KeyCode
kc
);
virtual
const
std
::
string
&
getAsString
(
KeyCode
kc
);
/** @copydoc Keyboard::copyKeyStates */
virtual
void
copyKeyStates
(
char
keys
[
256
]
)
const
;
virtual
void
copyKeyStates
(
char
keys
[
256
])
const
;
/** @copydoc Object::setBuffered */
virtual
void
setBuffered
(
bool
buffered
);
...
...
src/win32/Win32KeyBoard.cpp
View file @
6a6c0c87
...
...
@@ -286,7 +286,7 @@ bool Win32Keyboard::isKeyDown( KeyCode key ) const
}
//--------------------------------------------------------------------------------------------------//
const
std
::
string
&
Win32Keyboard
::
getAsString
(
KeyCode
kc
)
const
std
::
string
&
Win32Keyboard
::
getAsString
(
KeyCode
kc
)
{
char
temp
[
256
];
...
...
@@ -296,16 +296,16 @@ const std::string& Win32Keyboard::getAsString( KeyCode kc )
prop
.
diph
.
dwObj
=
static_cast
<
DWORD
>
(
kc
);
prop
.
diph
.
dwHow
=
DIPH_BYOFFSET
;
if
(
SUCCEEDED
(
mKeyboard
->
GetProperty
(
DIPROP_KEYNAME
,
&
prop
.
diph
)
)
)
if
(
SUCCEEDED
(
mKeyboard
->
GetProperty
(
DIPROP_KEYNAME
,
&
prop
.
diph
))
)
{
// convert the WCHAR in "wsz" to multibyte
if
(
WideCharToMultiByte
(
CP_ACP
,
0
,
prop
.
wsz
,
-
1
,
temp
,
sizeof
(
temp
),
NULL
,
NULL
)
)
return
mGetString
.
assign
(
temp
);
if
(
WideCharToMultiByte
(
CP_ACP
,
0
,
prop
.
wsz
,
-
1
,
temp
,
sizeof
(
temp
),
NULL
,
NULL
))
return
mGetString
.
assign
(
temp
);
}
std
::
stringstream
ss
;
ss
<<
"Key_"
<<
(
int
)
kc
;
return
mGetString
.
assign
(
ss
.
str
()
);
return
mGetString
.
assign
(
ss
.
str
());
}
//--------------------------------------------------------------------------------------------------//
...
...
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