Ticket #29: custom_key_layout.patch
| File custom_key_layout.patch, 3.6 KB (added by Matthias Bartsch, 4 years ago) |
|---|
-
src/ui/root.cc
144 144 m_bindings['A'] = sigc::bind(sigc::mem_fun(*this, &Root::adjust_down_throttle), 1); 145 145 m_bindings[':'] = sigc::bind(sigc::mem_fun(*this, &Root::adjust_down_throttle), -1); 146 146 147 } else {147 } else if (strncasecmp(keyLayout.c_str(), "custom", 6) != 0){ 148 148 m_bindings['a'] = sigc::bind(sigc::mem_fun(*this, &Root::adjust_up_throttle), 1); 149 149 m_bindings['z'] = sigc::bind(sigc::mem_fun(*this, &Root::adjust_up_throttle), -1); 150 150 m_bindings['A'] = sigc::bind(sigc::mem_fun(*this, &Root::adjust_down_throttle), 1); 151 151 m_bindings['Z'] = sigc::bind(sigc::mem_fun(*this, &Root::adjust_down_throttle), -1); 152 152 153 } 153 154 154 if (str casecmp(keyLayout.c_str(), "dvorak") != 0){155 if (strncasecmp(keyLayout.c_str(), "custom", 6) != 0){ 155 156 m_bindings['s'] = sigc::bind(sigc::mem_fun(*this, &Root::adjust_up_throttle), 5); 156 157 m_bindings['x'] = sigc::bind(sigc::mem_fun(*this, &Root::adjust_up_throttle), -5); 157 158 m_bindings['S'] = sigc::bind(sigc::mem_fun(*this, &Root::adjust_down_throttle), 5); … … 162 163 m_bindings['D'] = sigc::bind(sigc::mem_fun(*this, &Root::adjust_down_throttle), 50); 163 164 m_bindings['C'] = sigc::bind(sigc::mem_fun(*this, &Root::adjust_down_throttle), -50); 164 165 165 } else {166 } else if (strcasecmp(keyLayout.c_str(), "dvorak") == 0) { 166 167 m_bindings['o'] = sigc::bind(sigc::mem_fun(*this, &Root::adjust_up_throttle), 5); 167 168 m_bindings['q'] = sigc::bind(sigc::mem_fun(*this, &Root::adjust_up_throttle), -5); 168 169 m_bindings['O'] = sigc::bind(sigc::mem_fun(*this, &Root::adjust_down_throttle), 5); … … 172 173 m_bindings['j'] = sigc::bind(sigc::mem_fun(*this, &Root::adjust_up_throttle), -50); 173 174 m_bindings['E'] = sigc::bind(sigc::mem_fun(*this, &Root::adjust_down_throttle), 50); 174 175 m_bindings['J'] = sigc::bind(sigc::mem_fun(*this, &Root::adjust_down_throttle), -50); 176 175 177 } 176 178 179 if (strncasecmp(keyLayout.c_str(), "custom", 6) == 0 && keyLayout.length() >= 19){ 180 m_bindings[keyLayout[7]] = sigc::bind(sigc::mem_fun(*this, &Root::adjust_up_throttle), 1); 181 m_bindings[keyLayout[8]] = sigc::bind(sigc::mem_fun(*this, &Root::adjust_up_throttle), -1); 182 m_bindings[keyLayout[9]] = sigc::bind(sigc::mem_fun(*this, &Root::adjust_down_throttle), 1); 183 m_bindings[keyLayout[10]] = sigc::bind(sigc::mem_fun(*this, &Root::adjust_down_throttle), -1); 184 185 m_bindings[keyLayout[11]] = sigc::bind(sigc::mem_fun(*this, &Root::adjust_up_throttle), 5); 186 m_bindings[keyLayout[12]] = sigc::bind(sigc::mem_fun(*this, &Root::adjust_up_throttle), -5); 187 m_bindings[keyLayout[13]] = sigc::bind(sigc::mem_fun(*this, &Root::adjust_down_throttle), 5); 188 m_bindings[keyLayout[14]] = sigc::bind(sigc::mem_fun(*this, &Root::adjust_down_throttle), -5); 189 190 m_bindings[keyLayout[15]] = sigc::bind(sigc::mem_fun(*this, &Root::adjust_up_throttle), 50); 191 m_bindings[keyLayout[16]] = sigc::bind(sigc::mem_fun(*this, &Root::adjust_up_throttle), -50); 192 m_bindings[keyLayout[17]] = sigc::bind(sigc::mem_fun(*this, &Root::adjust_down_throttle), 50); 193 m_bindings[keyLayout[18]] = sigc::bind(sigc::mem_fun(*this, &Root::adjust_down_throttle), -50); 194 195 } 196 177 197 m_bindings['\x0C'] = sigc::mem_fun(m_control->display(), &display::Manager::force_redraw); // ^L 178 198 m_bindings['\x11'] = sigc::mem_fun(m_control, &Control::receive_normal_shutdown); // ^Q 179 199 }
