Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/keyboard_shortcuts.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ These shortcuts are meant to be used while the Notes window is currently focused
| <kbd>Ctrl</kbd> + <kbd>E</kbd> | Clear the search bar |
| <kbd>Ctrl</kbd> + <kbd>↓</kbd> (or just <kbd>↓</kbd>) | Select note below |
| <kbd>Ctrl</kbd> + <kbd>↑</kbd> (or just <kbd>↑</kbd>) | Select note above |
| <kbd>Ctrl</kbd> + <kbd>↓</kbd> (macOS) | Select note below |
| <kbd>Ctrl</kbd> + <kbd>↑</kbd> (macOS) | Select note above |
| <kbd>Ctrl</kbd> + <kbd>Enter</kbd> | Focus on the text editor |
| <kbd>Ctrl</kbd> + <kbd>L</kbd> (macOS) | Focus on the text editor |
| <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>F</kbd> | Toggle full screen mode |
| <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>K</kbd> | Toggle kanban view |
| <kbd>F11</kbd> | Toggle full screen mode |
Expand Down
6 changes: 6 additions & 0 deletions src/listviewlogic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ void ListViewLogic::deleteNoteRequested(const NodeData &note)

void ListViewLogic::selectNoteUp()
{
// Ensure the list view has focus
m_listView->setFocus();

auto currentIndex = m_listView->currentIndex();
if (currentIndex.isValid()) {
int currentRow = currentIndex.row();
Expand All @@ -209,6 +212,9 @@ void ListViewLogic::selectNoteUp()

void ListViewLogic::selectNoteDown()
{
// Ensure the list view has focus
m_listView->setFocus();

auto currentIndex = m_listView->currentIndex();
if (currentIndex.isValid()) {
int currentRow = currentIndex.row();
Expand Down
12 changes: 10 additions & 2 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -532,14 +532,22 @@ void MainWindow::setupKeyboardShortcuts()
new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_D), this, SLOT(deleteSelectedNote()));
new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_F), m_searchEdit, SLOT(setFocus()));
new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_E), m_searchEdit, SLOT(clear()));

// Add macOS-specific shortcuts for note navigation
#if defined(Q_OS_MACOS)
new QShortcut(QKeySequence(Qt::META | Qt::Key_Down), this, SLOT(selectNoteDown()));
new QShortcut(QKeySequence(Qt::META | Qt::Key_Up), this, SLOT(selectNoteUp()));
new QShortcut(QKeySequence(Qt::META | Qt::Key_L), this, SLOT(setFocusOnText()));
#else
new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_Down), this, SLOT(selectNoteDown()));
new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_Up), this, SLOT(selectNoteUp()));
new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_L), this, SLOT(setFocusOnText()));
#endif

new QShortcut(QKeySequence(Qt::Key_Down), this, SLOT(selectNoteDown()));
new QShortcut(QKeySequence(Qt::Key_Up), this, SLOT(selectNoteUp()));
new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_Enter), this, SLOT(setFocusOnText()));
new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_Return), this, SLOT(setFocusOnText()));
// new QShortcut(QKeySequence(Qt::Key_Enter), this, SLOT(setFocusOnText()));
// new QShortcut(QKeySequence(Qt::Key_Return), this, SLOT(setFocusOnText()));
new QShortcut(QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_F), this, SLOT(fullscreenWindow()));
new QShortcut(Qt::Key_F11, this, SLOT(fullscreenWindow()));
connect(new QShortcut(QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_L), this), &QShortcut::activated, this, [=]() { m_listView->setFocus(); });
Expand Down
Loading