| 245 | } |
| 246 | |
| 247 | void KeyMapping::default_hotkey(int hotkey_index) |
| 248 | { |
| 249 | /* Hotkey selected */ |
| 250 | HotKey hk = hotkey_list[hotkey_index]; |
| 251 | |
| 252 | /* Remove previous mapping from this key */ |
| 253 | for (auto iter : hotkey_mapping) { |
| 254 | if (iter.second == hk) { |
| 255 | hotkey_mapping.erase(iter.first); |
| 256 | break; |
| 257 | } |
| 258 | } |
| 259 | |
| 260 | if (hk.default_input.type == SingleInput::IT_KEYBOARD) |
| 261 | hotkey_mapping[hk.default_input.which] = hk; |
| 262 | |
| 263 | } |
| 264 | |
| 265 | void KeyMapping::reassign_hotkey(int hotkey_index, keysym_t ks) |
| 266 | { |