Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/keyboard.cc')
-rw-r--r--src/client/keyboard.cc32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/client/keyboard.cc b/src/client/keyboard.cc
index 23e6634..bf08db1 100644
--- a/src/client/keyboard.cc
+++ b/src/client/keyboard.cc
@@ -31,7 +31,7 @@ Keyboard::Keyboard()
// ------------------ ACTIONS
// FIXME actions should be state keys and not use key repeat
-
+
add_action("+left", Action::None, "rotate left");
add_action("+right", Action::None, "rotate right");
add_action("+up", Action::None, "rotate up");
@@ -253,12 +253,12 @@ Keyboard::~Keyboard()
{
// clear key map
for (iterator it = begin(); it != end(); it++)
- delete (*it).second;
+ delete(*it).second;
keys.clear();
-
+
// clear action list
- for(std::list<Action *>::iterator ait = actions.begin(); ait != actions.end(); ait++)
- delete (*ait);
+ for (std::list<Action *>::iterator ait = actions.begin(); ait != actions.end(); ait++)
+ delete(*ait);
actions.clear();
}
@@ -317,7 +317,7 @@ void Keyboard::load_binds()
con_print << " reading keyboard binds from " << filename << std::endl;
char line[MAXCMDSIZE];
- while (ifs.getline(line, MAXCMDSIZE-1)) {
+ while (ifs.getline(line, MAXCMDSIZE - 1)) {
if (line[0] && line[0] != '#' && line[0] != ';')
core::cmd() << line << '\n';
}
@@ -383,7 +383,7 @@ void Keyboard::bind(std::string const &name, const std::string str)
{
Key::Modifier modifier = Key::None;
std::string keyname(name);
-
+
if ((keyname.size() > 6) && (keyname.substr(0, 6).compare("shift+") == 0)) {
keyname.erase(0, 6);
modifier = Key::Shift;
@@ -393,7 +393,7 @@ void Keyboard::bind(std::string const &name, const std::string str)
} else if ((keyname.size() > 4) && (keyname.substr(0, 4).compare("alt+") == 0)) {
keyname.erase(0, 4);
modifier = Key::Alt;
-
+
} else if ((keyname.size() > 6) && (keyname.substr(keyname.size() - 6, 6).compare("+shift") == 0)) {
keyname.erase(keyname.size() - 6, 6);
modifier = Key::Shift;
@@ -401,10 +401,10 @@ void Keyboard::bind(std::string const &name, const std::string str)
keyname.erase(keyname.size() - 5, 5);
modifier = Key::Ctrl;
} else if ((keyname.size() > 4) && (keyname.substr(keyname.size() - 4, 4).compare("+alt") == 0)) {
- keyname.erase(0, keyname.size() -46);
+ keyname.erase(0, keyname.size() - 46);
modifier = Key::Alt;
}
-
+
Key *key = find(keyname);
if (key) {
if (str.size())
@@ -425,10 +425,10 @@ void Keyboard::bind(std::string const &name, const std::string str)
}
void Keyboard::unbind(std::string const &name)
-{
+{
Key::Modifier modifier = Key::None;
std::string keyname(name);
-
+
if ((keyname.size() > 6) && (keyname.substr(0, 6).compare("shift+") == 0)) {
keyname.erase(0, 6);
modifier = Key::Shift;
@@ -438,7 +438,7 @@ void Keyboard::unbind(std::string const &name)
} else if ((keyname.size() > 4) && (keyname.substr(0, 4).compare("alt+") == 0)) {
keyname.erase(0, 4);
modifier = Key::Alt;
-
+
} else if ((keyname.size() > 6) && (keyname.substr(keyname.size() - 6, 6).compare("+shift") == 0)) {
keyname.erase(keyname.size() - 6, 6);
modifier = Key::Shift;
@@ -446,7 +446,7 @@ void Keyboard::unbind(std::string const &name)
keyname.erase(keyname.size() - 5, 5);
modifier = Key::Ctrl;
} else if ((keyname.size() > 4) && (keyname.substr(keyname.size() - 4, 4).compare("+alt") == 0)) {
- keyname.erase(0, keyname.size() -46);
+ keyname.erase(0, keyname.size() - 46);
modifier = Key::Alt;
}
@@ -498,7 +498,7 @@ void Keyboard::list_keys()
void Keyboard::list_binds()
{
- size_t n =0;
+ size_t n = 0;
for (iterator it = begin(); it != end(); it++) {
if ((*it).second->bind(Key::None).size()) {
con_print << " " << aux::pad_right((*it).second->name(), 6) << " " << (*it).second->bind(Key::None) << std::endl;
@@ -719,7 +719,7 @@ void setkeyboardmode(bool input)
SDL_EnableKeyRepeat(250, SDL_DEFAULT_REPEAT_INTERVAL);
else
SDL_EnableKeyRepeat(10, SDL_DEFAULT_REPEAT_INTERVAL);
-
+
}
*/
} // namespace client