# 全屏作曲键盘快捷键仅能使用一次

**URL:** <https://meta.discourse.org/t/fullscreen-composer-keyboard-shortcut-works-only-once/101920>\
**Category:** Bug\
**Tags:** keyboard-shortcuts\
**Created:** [2018 年11 月 13 日 09:23 UTC](https://meta.discourse.org/t/fullscreen-composer-keyboard-shortcut-works-only-once/101920 "2018-11-13T09:23:43Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

作者： ![Johani](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/johani/32/176920_2.png) [@Johani](https://meta.discourse.org/u/Johani)\
发布日期： [2018 年11 月 14 日 03:18 UTC](https://meta.discourse.org/t/fullscreen-composer-keyboard-shortcut-works-only-once/101920/3 "2018-11-14T03:18:50Z")

</div>

The reason this happens is because the composer title steals focus when the composer is opened.

[https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/templates/composer.hbs#L62](https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/templates/composer.hbs#L62)

 ![1136](https://global.discourse-cdn.com/meta/original/3X/2/4/2417cbe367b2b774f2f462d51e7e78a9482e6d21.png)

So when you use the shortcut, you’re using it while the input is focused and that’s why it doesn’t work. You’d need to click somewhere outside to remove the focus from the input. Although slightly less obvious, the composer body text area - if focused - will also interfere with the shortcut.

When you enter full screen mode the title input is removed, when you exit, it gets re-inserted and steals focus again. This is why this occurs

> [@TheBestPessimist](#):
>
> It’s also weird that when the editor is in fullscreen if i keep `shift` pressed then quickly keep pressing `f11` multiple times, the editor goes full \<-\> not full _as long as the previous animation was not finished_ .

Mousetrap has a way to handle this, to add a `mousetrap` class to the markup of those elements, the shortcut would then fire even if the inputs are focused, but so will all the other keyboard shortcuts and it creates a lot more problems than it solves.

> [@sam](#):
>
> I wonder if we should pick a different shortcut here.

Sure, just let me know what works for you.

---

_[View the full topic](https://meta.discourse.org/t/fullscreen-composer-keyboard-shortcut-works-only-once/101920)._
