# Keyboard shortcut for closing a topic

**URL:** https://meta.discourse.org/t/keyboard-shortcut-for-closing-a-topic/135102
**Category:** Feature
**Tags:** keyboard-shortcuts
**Created:** [December 4, 2019, 10:29pm UTC](https://meta.discourse.org/t/keyboard-shortcut-for-closing-a-topic/135102 "2019-12-04T22:29:41Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![maiki](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/maiki/32/233950_2.png) [@maiki](https://meta.discourse.org/u/maiki)
#### Post date: [December 4, 2019, 10:29pm UTC](https://meta.discourse.org/t/keyboard-shortcut-for-closing-a-topic/135102/1 "2019-12-04T22:29:41Z")

</div>

Is there a keyboard shortcut to close a topic?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [December 5, 2019, 12:36am UTC](https://meta.discourse.org/t/keyboard-shortcut-for-closing-a-topic/135102/2 "2019-12-05T00:36:13Z")

</div>

No there is no such short cut, I think it makes sense to add a keyboard shortcut that opens the admin wrench, and then a second key like c could close a topic.

 ![image](https://global.discourse-cdn.com/meta/original/3X/5/b/5bdfa85fd9aba417fc3f9236c610f2e4aa7f71ba.png)

Going to mark this as a feature request.

Step 0 is figuring out what we want the shortcut to be for opening admin topic wrench.

---

<div class="post-metadata">

### Author: ![maiki](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/maiki/32/233950_2.png) [@maiki](https://meta.discourse.org/u/maiki)
#### Post date: [December 6, 2019, 1:06am UTC](https://meta.discourse.org/t/keyboard-shortcut-for-closing-a-topic/135102/3 "2019-12-06T01:06:20Z")

</div>

> [@sam](#):
>
> Step 0 is figuring out what we want the shortcut to be for opening admin topic wrench.

Are there shortcuts _not_ listed on the shortcut help modal?

Hey look, I can copy it!

> #### Jump To
> 
> - g, h Home
> - g, l Latest
> - g, n New
> - g, u Unread
> - g, c Categories
> - g, t Top
> - g, b Bookmarks
> - g, p Profile
> - g, m Messages
> - g, d Drafts
> 
> #### Navigation
> 
> - u Back
> - # Go to post #
> - k/j Move selection ↑ ↓
> - o or Enter Open selected topic
> - Shift+j/Shift+k Next/previous section
> - Shift+l Go to the first unread post
> 
> #### Application
> 
> - = Open hamburger menu
> - p Open user menu
> - . Show updated topics
> - / or Ctrl+Alt+f Search
> - ? Open keyboard help
> - x, r Dismiss New/Posts
> - x, t Dismiss Topics
> - Shift+z Shift+z Log Out
> 
> #### Composing
> 
> - Shift+c Return to composer
> - Shift+F11 Fullscreen composer
> - c Create a new topic
> - t Reply as linked topic
> - Shift+r Reply to topic
> - r Reply to post
> - q Quote post
> 
> #### Actions
> 
> - f Toggle bookmark topic
> - Shift+p Pin/Unpin topic
> - Shift+s Share topic
> - s Share post
> - l Like post
> - ! Flag post
> - b Bookmark post
> - e Edit post
> - d Delete post
> - m, m Mute topic
> - m, r Regular (default) topic
> - m, t Track topic
> - m, w Watch topic
> - Shift+u Defer topic
> - Ctrl+p Print topic

Aside from those, are any other reserved?

Also, I notice my keyboard is missing a wrench key (🔧), so _my_ first choice is out. ¯\_(ツ)\_/¯

---

<div class="post-metadata">

### Author: ![Nisutec](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nisutec/32/162327_2.png) [@Nisutec](https://meta.discourse.org/u/Nisutec)
#### Post date: [December 6, 2019, 6:30am UTC](https://meta.discourse.org/t/keyboard-shortcut-for-closing-a-topic/135102/4 "2019-12-06T06:30:15Z")

</div>

> [@sam](#):
>
> Step 0 is figuring out what we want the shortcut to be for opening admin topic wrench.

I suggest Shift + a for opening the admin wrench.

---

<div class="post-metadata">

### Author: ![hectorbus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hectorbus/32/264363_2.png) [@hectorbus](https://meta.discourse.org/u/hectorbus)
#### Post date: [December 12, 2019, 10:05pm UTC](https://meta.discourse.org/t/keyboard-shortcut-for-closing-a-topic/135102/5 "2019-12-12T22:05:54Z")

</div>

I like Shift + a for opening the admin wrench. Can I work on it by opening a PR in GitHub? @sam

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [December 12, 2019, 10:22pm UTC](https://meta.discourse.org/t/keyboard-shortcut-for-closing-a-topic/135102/6 "2019-12-12T22:22:19Z")

</div>

Yeah I think you can give it a shot in a PR the tricky thing though is that you need to be able to select stuff using the keyboard once it is open.

How do you foresee that working?

---

<div class="post-metadata">

### Author: ![hectorbus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hectorbus/32/264363_2.png) [@hectorbus](https://meta.discourse.org/u/hectorbus)
#### Post date: [December 12, 2019, 10:40pm UTC](https://meta.discourse.org/t/keyboard-shortcut-for-closing-a-topic/135102/7 "2019-12-12T22:40:36Z")

</div>

What about if once the admin wrench is open, navigate through it using the Up and Down keys? Then hitting Enter to select the option. I don’t know if this is possible, but just like an idea…

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [December 12, 2019, 10:50pm UTC](https://meta.discourse.org/t/keyboard-shortcut-for-closing-a-topic/135102/8 "2019-12-12T22:50:20Z")

</div>

> [@hectorbus](#):
>
> What about if once the admin wrench is open, navigate through it using the Up and Down keys?

I support this if you can swing it, we do it on search, highlighting the selected button though may be a bit tricky, can you give it a shot and post a screenshot ?

---

<div class="post-metadata">

### Author: ![hectorbus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hectorbus/32/264363_2.png) [@hectorbus](https://meta.discourse.org/u/hectorbus)
#### Post date: [December 12, 2019, 10:56pm UTC](https://meta.discourse.org/t/keyboard-shortcut-for-closing-a-topic/135102/9 "2019-12-12T22:56:38Z")

</div>

Sure, I let you know when a I have something.

---

<div class="post-metadata">

### Author: ![hectorbus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hectorbus/32/264363_2.png) [@hectorbus](https://meta.discourse.org/u/hectorbus)
#### Post date: [December 17, 2019, 5:08am UTC](https://meta.discourse.org/t/keyboard-shortcut-for-closing-a-topic/135102/10 "2019-12-17T05:08:04Z")

</div>

I have been having some trouble understanding ember.js, I have never worked with it before. I did this PR that only opens the topic admin menu, I hope this helps. If someone could help me with the other part, it will be greatly appreciated.

[https://github.com/discourse/discourse/pull/8568](https://github.com/discourse/discourse/pull/8568)

---

<div class="post-metadata">

### Author: ![mittals24](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittals24/32/172259_2.png) [@mittals24](https://meta.discourse.org/u/mittals24)
#### Post date: [March 10, 2020, 7:30pm UTC](https://meta.discourse.org/t/keyboard-shortcut-for-closing-a-topic/135102/11 "2020-03-10T19:30:31Z")

</div>

Shift+a is working. But the arrow keys do not work inside the menu. Would love to have shortcuts for some of tasks like Close, timers, etc.

On that note - is there a different way to add my personal keyboard shortcuts for a sequence of UI clicks? Maybe a chrome extension?

---

<div class="post-metadata">

### Author: ![mittals24](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittals24/32/172259_2.png) [@mittals24](https://meta.discourse.org/u/mittals24)
#### Post date: [March 10, 2020, 8:58pm UTC](https://meta.discourse.org/t/keyboard-shortcut-for-closing-a-topic/135102/12 "2020-03-10T20:58:44Z")

</div>

Update: Dug a bit in the code. Close topic shortcut can be very similar to the pinUnpinTopic and deferTopic shortcuts. Simply call [toggleClosed](https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/controllers/topic.js.es6#L899) on the topic class.

```plaintext
 pinUnpinTopic() {
    this.container.lookup("controller:topic").togglePinnedState();
  },

```

@hectorbus - is this something you could put in? How about Shift+c for close? I would have done it myself - not setup for github and coding right now though.

---

<div class="post-metadata">

### Author: ![hectorbus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hectorbus/32/264363_2.png) [@hectorbus](https://meta.discourse.org/u/hectorbus)
#### Post date: [March 11, 2020, 5:48am UTC](https://meta.discourse.org/t/keyboard-shortcut-for-closing-a-topic/135102/13 "2020-03-11T05:48:06Z")

</div>

I believe that the arrow keys feature was never implemented, I tried to work on it but I wasn’t successful. Regarding to the personal keyboard shortcut, I’m not sure if there is a way to build that chrome extension, you could give it a try; also, a new PR can be made with that new keyboard shortcut, as long the code and functionality is approved.

---

<div class="post-metadata">

### Author: ![hectorbus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hectorbus/32/264363_2.png) [@hectorbus](https://meta.discourse.org/u/hectorbus)
#### Post date: [March 11, 2020, 5:50am UTC](https://meta.discourse.org/t/keyboard-shortcut-for-closing-a-topic/135102/14 "2020-03-11T05:50:30Z")

</div>

Let me check out the code and see if the toggleClosed would work, I don’t see why not.
