| 650 | } |
| 651 | |
| 652 | void InputEditorView::addInputColumn() |
| 653 | { |
| 654 | /* Get an input from the user */ |
| 655 | keysym_t ks = ensureKeyDialog()->exec(); |
| 656 | |
| 657 | /* Remove the custom modifiers that we added in that function */ |
| 658 | ks = ks & 0xffff; |
| 659 | |
| 660 | if (ks != 0) { |
| 661 | /* Get the remapped input if available */ |
| 662 | if (context->config.km->input_mapping.find(ks) != context->config.km->input_mapping.end()) { |
| 663 | ks = context->config.km->input_mapping[ks].which; |
| 664 | } |
| 665 | |
| 666 | /* Get the input with description if available */ |
| 667 | for (int i=0; i<KeyMapping::INPUTLIST_SIZE; i++) { |
| 668 | for (auto iter : context->config.km->input_list[i]) { |
| 669 | if (iter.type == SingleInput::IT_KEYBOARD) { |
| 670 | if (iter.which == ks) { |
| 671 | inputEditorModel->addUniqueInput(iter); |
| 672 | return; |
| 673 | } |
| 674 | } |
| 675 | } |
| 676 | } |
| 677 | |
| 678 | /* Didn't find the input in the list, insert it with the value as description */ |
| 679 | SingleInput si; |
| 680 | si.type = SingleInput::IT_KEYBOARD; |
| 681 | si.which = ks; |
| 682 | si.description = std::to_string(ks); |
| 683 | inputEditorModel->addUniqueInput(si); |
| 684 | } |
| 685 | } |
| 686 | |
| 687 | void InputEditorView::clearInputColumn() |
| 688 | { |
nothing calls this directly
no test coverage detected