# Ctrl-J / Ctrl-K Hotkey for navigation within command palette and quick switcher

**URL:** <https://forum.obsidian.md/t/ctrl-j-ctrl-k-hotkey-for-navigation-within-command-palette-and-quick-switcher/7751>\
**Category:** Feature requests\
**Tags:** valuable, keyboard-shortcut\
**Created:** [October 28, 2020, 12:09pm UTC](https://forum.obsidian.md/t/ctrl-j-ctrl-k-hotkey-for-navigation-within-command-palette-and-quick-switcher/7751 "2020-10-28T12:09:05Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![anotherroot](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/a/3d9bf3/32.png) [@anotherroot](https://forum.obsidian.md/u/anotherroot)\
**Post date:** [November 18, 2022, 9:57am UTC](https://forum.obsidian.md/t/ctrl-j-ctrl-k-hotkey-for-navigation-within-command-palette-and-quick-switcher/7751/10 "2022-11-18T09:57:55Z")

</div>

I made it work by calling this JS code at obsidian startup. You can do this with various plugins or by making your own plugin.

```javascript

    document.addEventListener('keydown',(e) =>{
        if (e.code == "KeyN" && e.ctrlKey && !e.shiftKey && !e.metaKey){
            document.dispatchEvent(new KeyboardEvent("keydown",{"key":"ArrowDown","code":"ArrowDown"}))
        }
    });

    document.addEventListener('keydown',(e) =>{
        if (e.code == "KeyP" && e.ctrlKey && !e.shiftKey && !e.metaKey){
            document.dispatchEvent(new KeyboardEvent("keydown",{"key":"ArrowUp","code":"ArrowUp"}))
        }
    });

```

This code listens for Ctrl+N and Ctrl+P key press events and creates a new ArrowDown/ArrowUp event.

It could be made more specific by attaching the event listener to the specific DOM elements where you want this functionality.

---

_[View the full topic](https://forum.obsidian.md/t/ctrl-j-ctrl-k-hotkey-for-navigation-within-command-palette-and-quick-switcher/7751)._
