LogViewer
A modern log viewer with AI-assisted analysis (Qt 6)
Loading...
Searching...
No Matches
ui::qt::utils::KeyboardNavigationManager Class Reference

Manages keyboard navigation and shortcuts throughout the application. More...

#include <KeyboardNavigationManager.hpp>

Inheritance diagram for ui::qt::utils::KeyboardNavigationManager:
Inheritance graph
Collaboration diagram for ui::qt::utils::KeyboardNavigationManager:
Collaboration graph

Public Member Functions

 KeyboardNavigationManager (QWidget *mainWindow)
 
void registerShortcut (const QKeySequence &key, const QString &description, std::function< void()> handler)
 Register a keyboard shortcut with a handler.
 
bool handleKeyPress (QKeyEvent *event)
 Handle key press event.
 
void navigateToNextPanel ()
 Navigate to next panel (Ctrl+Tab)
 
void navigateToPreviousPanel ()
 Navigate to previous panel (Ctrl+Shift+Tab)
 
void navigateDown ()
 Navigate down in table (Down arrow or J)
 
void navigateUp ()
 Navigate up in table (Up arrow or K)
 
void navigateLeft ()
 Navigate left in table (Left arrow or H)
 
void navigateRight ()
 Navigate right in table (Right arrow or L)
 
void jumpToFirst ()
 Jump to first row (Home or G+G)
 
void jumpToLast ()
 Jump to last row (End)
 
void jumpToRow (int row)
 Jump to row by number (: followed by number)
 
void setVimKeybindingsEnabled (bool enabled)
 Enable/disable Vim-like keybindings.
 
bool areVimKeybindingsEnabled () const
 
const std::map< QString, QString > & shortcuts () const
 Get all registered shortcuts.
 

Private Member Functions

void setupDefaultShortcuts ()
 
bool handleVimBindings (QKeyEvent *event)
 
bool handleStandardBindings (QKeyEvent *event)
 

Private Attributes

QWidget * m_mainWindow
 
std::map< int, std::function< void()> > m_shortcuts
 
std::map< QString, QString > m_shortcutDescriptions
 
bool m_vimKeybindingsEnabled {false}
 
bool m_vimGGPressed {false}
 

Detailed Description

Manages keyboard navigation and shortcuts throughout the application.

Provides:

  • Tab navigation between panels
  • Arrow key navigation in tables
  • Vim-like keybindings (hjkl)
  • Quick access shortcuts
  • Focus management

Constructor & Destructor Documentation

◆ KeyboardNavigationManager()

ui::qt::utils::KeyboardNavigationManager::KeyboardNavigationManager ( QWidget *  mainWindow)
explicit
Here is the call graph for this function:

Member Function Documentation

◆ areVimKeybindingsEnabled()

bool ui::qt::utils::KeyboardNavigationManager::areVimKeybindingsEnabled ( ) const
inline

◆ handleKeyPress()

bool ui::qt::utils::KeyboardNavigationManager::handleKeyPress ( QKeyEvent *  event)

Handle key press event.

Here is the call graph for this function:

◆ handleStandardBindings()

bool ui::qt::utils::KeyboardNavigationManager::handleStandardBindings ( QKeyEvent *  event)
private
Here is the caller graph for this function:

◆ handleVimBindings()

bool ui::qt::utils::KeyboardNavigationManager::handleVimBindings ( QKeyEvent *  event)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ jumpToFirst()

void ui::qt::utils::KeyboardNavigationManager::jumpToFirst ( )

Jump to first row (Home or G+G)

Here is the call graph for this function:
Here is the caller graph for this function:

◆ jumpToLast()

void ui::qt::utils::KeyboardNavigationManager::jumpToLast ( )

Jump to last row (End)

Here is the call graph for this function:
Here is the caller graph for this function:

◆ jumpToRow()

void ui::qt::utils::KeyboardNavigationManager::jumpToRow ( int  row)

Jump to row by number (: followed by number)

Here is the call graph for this function:

◆ navigateDown()

void ui::qt::utils::KeyboardNavigationManager::navigateDown ( )

Navigate down in table (Down arrow or J)

Here is the caller graph for this function:

◆ navigateLeft()

void ui::qt::utils::KeyboardNavigationManager::navigateLeft ( )

Navigate left in table (Left arrow or H)

Here is the caller graph for this function:

◆ navigateRight()

void ui::qt::utils::KeyboardNavigationManager::navigateRight ( )

Navigate right in table (Right arrow or L)

Here is the caller graph for this function:

◆ navigateToNextPanel()

void ui::qt::utils::KeyboardNavigationManager::navigateToNextPanel ( )

Navigate to next panel (Ctrl+Tab)

Here is the call graph for this function:
Here is the caller graph for this function:

◆ navigateToPreviousPanel()

void ui::qt::utils::KeyboardNavigationManager::navigateToPreviousPanel ( )

Navigate to previous panel (Ctrl+Shift+Tab)

Here is the call graph for this function:
Here is the caller graph for this function:

◆ navigateUp()

void ui::qt::utils::KeyboardNavigationManager::navigateUp ( )

Navigate up in table (Up arrow or K)

Here is the caller graph for this function:

◆ registerShortcut()

void ui::qt::utils::KeyboardNavigationManager::registerShortcut ( const QKeySequence &  key,
const QString &  description,
std::function< void()>  handler 
)

Register a keyboard shortcut with a handler.

Here is the caller graph for this function:

◆ setupDefaultShortcuts()

void ui::qt::utils::KeyboardNavigationManager::setupDefaultShortcuts ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setVimKeybindingsEnabled()

void ui::qt::utils::KeyboardNavigationManager::setVimKeybindingsEnabled ( bool  enabled)
inline

Enable/disable Vim-like keybindings.

◆ shortcuts()

const std::map< QString, QString > & ui::qt::utils::KeyboardNavigationManager::shortcuts ( ) const
inline

Get all registered shortcuts.

Member Data Documentation

◆ m_mainWindow

QWidget* ui::qt::utils::KeyboardNavigationManager::m_mainWindow
private

◆ m_shortcutDescriptions

std::map<QString, QString> ui::qt::utils::KeyboardNavigationManager::m_shortcutDescriptions
private

◆ m_shortcuts

std::map<int, std::function<void()> > ui::qt::utils::KeyboardNavigationManager::m_shortcuts
private

◆ m_vimGGPressed

bool ui::qt::utils::KeyboardNavigationManager::m_vimGGPressed {false}
private

◆ m_vimKeybindingsEnabled

bool ui::qt::utils::KeyboardNavigationManager::m_vimKeybindingsEnabled {false}
private

The documentation for this class was generated from the following files: