| 961 | } |
| 962 | |
| 963 | bool UIAbstractTableView::tryBeginEditing( KeyBindings::Shortcut fromShortcut ) { |
| 964 | if ( isEditable() && getSelection().first().isValid() && getModel() && |
| 965 | getModel()->isEditable( getSelection().first() ) && |
| 966 | ( mEditTriggers & EditTrigger::EditKeyPressed ) && !mEditShortcuts.empty() ) { |
| 967 | fromShortcut = KeyBindings::sanitizeShortcut( fromShortcut ); |
| 968 | for ( const auto& shortcut : mEditShortcuts ) { |
| 969 | if ( shortcut == fromShortcut ) { |
| 970 | beginEditing( getSelection().first(), getCellFromIndex( getSelection().first() ) ); |
| 971 | return true; |
| 972 | } |
| 973 | } |
| 974 | } |
| 975 | return false; |
| 976 | } |
| 977 | |
| 978 | Uint32 UIAbstractTableView::onKeyDown( const KeyEvent& event ) { |
| 979 | if ( tryBeginEditing( KeyBindings::Shortcut{ event.getKeyCode(), event.getMod() } ) ) |
nothing calls this directly
no test coverage detected