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
c02cf281
Commit
c02cf281
authored
Nov 06, 2015
by
TheOnlyJoey
Browse files
Introduced getAsKeyCode (Currently just for linux) to be able to map string to keycode
parent
a3f509e2
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
459 additions
and
427 deletions
+459
-427
includes/OISKeyboard.h
includes/OISKeyboard.h
+12
-0
includes/linux/LinuxKeyboard.h
includes/linux/LinuxKeyboard.h
+3
-0
includes/mac/MacKeyboard.h
includes/mac/MacKeyboard.h
+1
-0
includes/win32/Win32KeyBoard.h
includes/win32/Win32KeyBoard.h
+3
-0
src/linux/LinuxKeyboard.cpp
src/linux/LinuxKeyboard.cpp
+440
-427
No files found.
includes/OISKeyboard.h
View file @
c02cf281
...
...
@@ -281,6 +281,18 @@ namespace OIS
Alt
=
0x0000100
};
/**
@remarks
Translates string to KeyCode representation.
For example, "Enter" will be KC_ENTER - Locale
specific of course.
@param str
string to convert
@returns
The matching KeyCode
*/
virtual
OIS
::
KeyCode
getAsKeyCode
(
std
::
string
str
)
=
0
;
/**
@remarks
Check modifier status
...
...
includes/linux/LinuxKeyboard.h
View file @
c02cf281
...
...
@@ -42,6 +42,9 @@ namespace OIS
/** @copydoc Keyboard::getAsString */
virtual
const
std
::
string
&
getAsString
(
KeyCode
kc
);
/** @copydoc Keyboard::getAsKeyCode */
virtual
OIS
::
KeyCode
getAsKeyCode
(
std
::
string
str
);
/** @copydoc Keyboard::copyKeyStates */
virtual
void
copyKeyStates
(
char
keys
[
256
]
)
const
;
...
...
includes/mac/MacKeyboard.h
View file @
c02cf281
...
...
@@ -54,6 +54,7 @@ namespace OIS
// Returns a description of the given key
virtual
std
::
string
&
getAsString
(
KeyCode
key
);
virtual
KeyCode
getAsKeyCode
(
std
::
string
str
)
{
/*TODO: Implement OS version*/
;}
virtual
Interface
*
queryInterface
(
Interface
::
IType
type
)
{
return
0
;
}
...
...
includes/win32/Win32KeyBoard.h
View file @
c02cf281
...
...
@@ -50,6 +50,9 @@ namespace OIS
/** @copydoc Keyboard::getAsString */
virtual
const
std
::
string
&
getAsString
(
KeyCode
kc
);
/** @copydoc Keyboard::getAsKeyCode */
virtual
KeyCode
getAsKeyCode
(
std
::
string
str
)
{
/*TODO: Implement OS version*/
;}
/** @copydoc Keyboard::copyKeyStates */
virtual
void
copyKeyStates
(
char
keys
[
256
])
const
;
...
...
src/linux/LinuxKeyboard.cpp
View file @
c02cf281
This diff is collapsed.
Click to expand it.
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